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.

16878 lines
686 KiB

  1. # API Documentation
  2. This file describes all of the public methods, variables and events utilised by the VRTK prefabs and scripts.
  3. * [Prefabs](#prefabs-vrtkprefabs)
  4. * [Pointers](#pointers-vrtksourcescriptspointers)
  5. * [Pointer Renderers](#pointer-renderers-vrtksourcescriptspointerspointerrenderers)
  6. * [Locomotion](#locomotion-vrtksourcescriptslocomotion)
  7. * [Object Control Actions](#object-control-actions-vrtksourcescriptslocomotionobjectcontrolactions)
  8. * [Highlighters](#highlighters-vrtksourcescriptsinteractionshighlighters)
  9. * [Interactors](#interactors-vrtksourcescriptsinteractionsinteractors)
  10. * [Interactables](#interactables-vrtksourcescriptsinteractionsinteractables)
  11. * [Grab Attach Mechanics](#grab-attach-mechanics-vrtksourcescriptsinteractionsgrabattachmechanics)
  12. * [Secondary Controller Grab Actions](#secondary-controller-grab-actions-vrtksourcescriptsinteractionssecondarycontrollergrabactions)
  13. * [Controllables](#controllables-vrtksourcescriptsinteractionscontrollables)
  14. * [Physics Controllables](#physics-controllables-vrtksourcescriptsinteractionscontrollablesphysics)
  15. * [Artificial Controllables](#artificial-controllables-vrtksourcescriptsinteractionscontrollablesartificial)
  16. * [Presence](#presence-vrtksourcescriptspresence)
  17. * [UI](#ui-vrtksourcescriptsui)
  18. * [Utilities](#utilities-vrtksourcescriptsutilities)
  19. * [Base SDK](#base-sdk-vrtksourcesdkbase)
  20. * [Fallback SDK](#fallback-sdk-vrtksourcesdkfallback)
  21. * [Unity SDK](#unity-sdk-vrtksourcesdkunity)
  22. * [Simulator SDK](#simulator-sdk-vrtksourcesdksimulator)
  23. * [SteamVR SDK](#steamvr-sdk-vrtksourcesdksteamvr)
  24. * [Oculus SDK](#oculus-sdk-vrtksourcesdkoculus)
  25. * [WindowsMR SDK](#windowsmr-sdk-vrtksourcesdkwindowsmr)
  26. * [Daydream SDK](#daydream-sdk-vrtksourcesdkdaydream)
  27. * [Ximmerse SDK](#ximmerse-sdk-vrtksourcesdkximmerse)
  28. * [HyperealVR SDK](#hyperealvr-sdk-vrtksourcesdkhyperealvr)
  29. ---
  30. # Prefabs (VRTK/Prefabs)
  31. A collection of pre-defined usable prefabs have been included to allow for each drag-and-drop set up of common elements.
  32. * [SDK Setup Switcher](#sdk-setup-switcher-vrtk_sdksetupswitcher)
  33. * [Console Viewer Canvas](#console-viewer-canvas-vrtk_consoleviewer)
  34. * [Frames Per Second Canvas](#frames-per-second-canvas-vrtk_framespersecondviewer)
  35. * [Desktop Camera](#desktop-camera-vrtk_desktopcamera)
  36. * [Controller Rigidbody Activator](#controller-rigidbody-activator-vrtk_controllerrigidbodyactivator)
  37. * [Object Tooltip](#object-tooltip-vrtk_objecttooltip)
  38. * [Controller Tooltips](#controller-tooltips-vrtk_controllertooltips)
  39. * [Snap Drop Zone](#snap-drop-zone-vrtk_snapdropzone)
  40. * [Destination Point](#destination-point-vrtk_destinationpoint)
  41. * [Pointer Direction Indicator](#pointer-direction-indicator-vrtk_pointerdirectionindicator)
  42. * [Radial Menu](#radial-menu-vrtk_radialmenu)
  43. * [Independent Radial Menu](#independent-radial-menu-vrtk_independentradialmenucontroller)
  44. * [Panel Menu](#panel-menu-vrtk_panelmenucontroller)
  45. * [Panel Menu Item](#panel-menu-item-vrtk_panelmenuitemcontroller)
  46. * [Avatar Hands](#avatar-hands-vrtk_avatarhandcontroller)
  47. ---
  48. ## SDK Setup Switcher (VRTK_SDKSetupSwitcher)
  49. ### Overview
  50. Provides a GUI overlay to allow switching the loaded VRTK_SDKSetup of the the current VRTK_SDKManager.
  51. **Prefab Usage:**
  52. * Place the `VRTK/Prefabs/SDKSetupSwitcher/SDKSetupSwitcher` prefab into the scene hierarchy.
  53. ---
  54. ## Console Viewer Canvas (VRTK_ConsoleViewer)
  55. ### Overview
  56. Adds an in-scene representation of the Unity console on a world space canvas.
  57. **Prefab Usage:**
  58. * Place the `VRTK/Prefabs/ConsoleViewerCanvas/ConsoleViewerCanvas` prefab into the scene hierarchy.
  59. > It is also possible to interact with the `ConsoleViewerCanvas` with a `VRTK_UIPointer`.
  60. ### Inspector Parameters
  61. * **Font Size:** The size of the font the log text is displayed in.
  62. * **Info Message:** The colour of the text for an info log message.
  63. * **Assert Message:** The colour of the text for an assertion log message.
  64. * **Warning Message:** The colour of the text for a warning log message.
  65. * **Error Message:** The colour of the text for an error log message.
  66. * **Exception Message:** The colour of the text for an exception log message.
  67. ### Class Methods
  68. #### SetCollapse/1
  69. > `public virtual void SetCollapse(bool state)`
  70. * Parameters
  71. * `bool state` - The state of whether to collapse the output messages, true will collapse and false will not collapse.
  72. * Returns
  73. * _none_
  74. The SetCollapse method determines whether the console will collapse same message output into the same line. A state of `true` will collapse messages and `false` will print the same message for each line.
  75. #### ClearLog/0
  76. > `public virtual void ClearLog()`
  77. * Parameters
  78. * _none_
  79. * Returns
  80. * _none_
  81. The ClearLog method clears the current log view of all messages
  82. ---
  83. ## Frames Per Second Canvas (VRTK_FramesPerSecondViewer)
  84. ### Overview
  85. Provides a frames per second text element to the HMD view. To use the prefab it must be placed into the scene then the headset camera needs attaching to the canvas:
  86. **Prefab Usage:**
  87. * Place the `VRTK/Prefabs/FramesPerSecondCanvas/FramesPerSecondCanvas` prefab in the scene hierarchy.
  88. > This script is largely based on the script at: http://talesfromtherift.com/vr-fps-counter/ So all credit to Peter Koch for his work. Twitter: @peterept
  89. ### Inspector Parameters
  90. * **Display FPS:** Toggles whether the FPS text is visible.
  91. * **Target FPS:** The frames per second deemed acceptable that is used as the benchmark to change the FPS text colour.
  92. * **Font Size:** The size of the font the FPS is displayed in.
  93. * **Position:** The position of the FPS text within the headset view.
  94. * **Good Color:** The colour of the FPS text when the frames per second are within reasonable limits of the Target FPS.
  95. * **Warn Color:** The colour of the FPS text when the frames per second are falling short of reasonable limits of the Target FPS.
  96. * **Bad Color:** The colour of the FPS text when the frames per second are at an unreasonable level of the Target FPS.
  97. ### Example
  98. `VRTK/Examples/018_CameraRig_FramesPerSecondCounter` displays the frames per second in the centre of the headset view. Pressing the trigger generates a new sphere and pressing the touchpad generates ten new spheres. Eventually when lots of spheres are present the FPS will drop and demonstrate the prefab.
  99. ---
  100. ## Desktop Camera (VRTK_DesktopCamera)
  101. ### Overview
  102. Allows rendering a separate camera that is shown on the desktop only, without changing what's seen in VR headsets.
  103. **Prefab Usage:**
  104. * Place the `VRTK/Prefabs/DesktopCamera/DesktopCamera` prefab in the scene.
  105. ### Inspector Parameters
  106. * **Desktop Camera:** The camera to use for the desktop view. If left blank the camera on the game object this script is attached to or any of its children will be used.
  107. * **Follow Script:** The follow script to use for following the headset. If left blank the follow script on the game object this script is attached to or any of its children will be used.
  108. * **Headset Image:** The optional image to render the headset's view into. Can be left blank.
  109. * **Headset Render Texture:** The optional render texture to render the headset's view into. Can be left blank. If this is blank and `headsetImage` is set a default render texture will be created.
  110. ---
  111. ## Controller Rigidbody Activator (VRTK_ControllerRigidbodyActivator)
  112. ### Overview
  113. Provides a simple trigger collider volume that when a controller enters will enable the rigidbody on the controller.
  114. **Prefab Usage:**
  115. * Place the `VRTK/Prefabs/ControllerRigidbodyActivator/ControllerRigidbodyActivator` prefab in the scene at the location where the controller rigidbody should be automatically activated.
  116. * The prefab contains a default sphere collider to determine ths collision, this collider component can be customised in the inspector or can be replaced with another collider component (set to `Is Trigger`).
  117. > If the prefab is placed as a child of the target Interactable Object then the collider volume on the prefab will trigger collisions on the Interactable Object.
  118. ### Inspector Parameters
  119. * **Is Enabled:** If this is checked then the Collider will have it's Rigidbody toggled on and off during a collision.
  120. * **Activate Interact Touch:** If this is checked then the Rigidbody Activator will activate the rigidbody and colliders on the Interact Touch script.
  121. * **Activate Tracked Collider:** If this is checked then the Rigidbody Activator will activate the rigidbody and colliders on the Controller Tracked Collider script.
  122. ### Class Events
  123. * `ControllerRigidbodyOn` - Emitted when the controller rigidbody is turned on.
  124. * `ControllerRigidbodyOff` - Emitted when the controller rigidbody is turned off.
  125. ### Unity Events
  126. Adding the `VRTK_ControllerRigidbodyActivator_UnityEvents` component to `VRTK_ControllerRigidbodyActivator` object allows access to `UnityEvents` that will react identically to the Class Events.
  127. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  128. ### Event Payload
  129. * ` interactingObject` - The object that touching the activator.
  130. ---
  131. ## Object Tooltip (VRTK_ObjectTooltip)
  132. ### Overview
  133. Adds a World Space Canvas that can be used to provide additional information about an object by providing a piece of text with a line drawn to a destination point.
  134. **Prefab Usage:**
  135. * Place the `VRTK/Prefabs/ObjectTooltip/ObjectTooltip` prefab into the scene hierarchy, preferably as a child of the GameObject it is associated with.
  136. * Set the `Draw Line To` option to the Transform component of the GameObject the Tooltip will be assoicated with.
  137. ### Inspector Parameters
  138. * **Display Text:** The text that is displayed on the tooltip.
  139. * **Font Size:** The size of the text that is displayed.
  140. * **Container Size:** The size of the tooltip container where `x = width` and `y = height`.
  141. * **Draw Line From:** An optional transform of where to start drawing the line from. If one is not provided the centre of the tooltip is used for the initial line position.
  142. * **Draw Line To:** A transform of another object in the scene that a line will be drawn from the tooltip to, this helps denote what the tooltip is in relation to. If no transform is provided and the tooltip is a child of another object, then the parent object's transform will be used as this destination position.
  143. * **Line Width:** The width of the line drawn between the tooltip and the destination transform.
  144. * **Font Color:** The colour to use for the text on the tooltip.
  145. * **Container Color:** The colour to use for the background container of the tooltip.
  146. * **Line Color:** The colour to use for the line drawn between the tooltip and the destination transform.
  147. * **Always Face Headset:** If this is checked then the tooltip will be rotated so it always face the headset.
  148. ### Class Events
  149. * `ObjectTooltipReset` - Emitted when the object tooltip is reset.
  150. * `ObjectTooltipTextUpdated` - Emitted when the object tooltip text is updated.
  151. ### Unity Events
  152. Adding the `VRTK_ObjectTooltip_UnityEvents` component to `VRTK_ObjectTooltip` object allows access to `UnityEvents` that will react identically to the Class Events.
  153. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  154. ### Event Payload
  155. * `string newText` - The optional new text that is given to the tooltip.
  156. ### Class Methods
  157. #### ResetTooltip/0
  158. > `public virtual void ResetTooltip()`
  159. * Parameters
  160. * _none_
  161. * Returns
  162. * _none_
  163. The ResetTooltip method resets the tooltip back to its initial state.
  164. #### UpdateText/1
  165. > `public virtual void UpdateText(string newText)`
  166. * Parameters
  167. * `string newText` - A string containing the text to update the tooltip to display.
  168. * Returns
  169. * _none_
  170. The UpdateText method allows the tooltip text to be updated at runtime.
  171. ### Example
  172. `VRTK/Examples/029_Controller_Tooltips` displays two cubes that have an object tooltip added to them along with tooltips that have been added to the controllers.
  173. ---
  174. ## Controller Tooltips (VRTK_ControllerTooltips)
  175. ### Overview
  176. Adds a collection of Object Tooltips to the Controller providing information to what the controller buttons may do.
  177. **Prefab Usage:**
  178. * Place the `VRTK/Prefabs/ControllerTooltips/ControllerTooltips` prefab as a child of the relevant controller script alias GameObject in the scene hierarchy.
  179. * If no `Button Transform Settings` are provided in the inspector at Edit time then the button transforms will attempt to be set to the transforms of the current SDK default controller model.
  180. * If one of the `Button Text Settings` text options are not provided, then the tooltip for that specific button will be hidden.
  181. > There are a number of parameters that can be set on the Prefab which are provided by the `VRTK_ControllerTooltips` script which is applied to the prefab.
  182. ### Inspector Parameters
  183. * **Trigger Text:** The text to display for the trigger button action.
  184. * **Grip Text:** The text to display for the grip button action.
  185. * **Touchpad Text:** The text to display for the touchpad action.
  186. * **Touchpad Two Text:** The text to display for the touchpad two action.
  187. * **Button One Text:** The text to display for button one action.
  188. * **Button Two Text:** The text to display for button two action.
  189. * **Start Menu Text:** The text to display for the start menu action.
  190. * **Tip Background Color:** The colour to use for the tooltip background container.
  191. * **Tip Text Color:** The colour to use for the text within the tooltip.
  192. * **Tip Line Color:** The colour to use for the line between the tooltip and the relevant controller button.
  193. * **Trigger:** The transform for the position of the trigger button on the controller.
  194. * **Grip:** The transform for the position of the grip button on the controller.
  195. * **Touchpad:** The transform for the position of the touchpad button on the controller.
  196. * **Touchpad Two:** The transform for the position of the touchpad two button on the controller.
  197. * **Button One:** The transform for the position of button one on the controller.
  198. * **Button Two:** The transform for the position of button two on the controller.
  199. * **Start Menu:** The transform for the position of the start menu on the controller.
  200. * **Controller Events:** The controller to read the controller events from. If this is blank then it will attempt to get a controller events script from the same or parent GameObject.
  201. * **Headset Controller Aware:** The headset controller aware script to use to see if the headset is looking at the controller. If this is blank then it will attempt to get a controller events script from the same or parent GameObject.
  202. * **Hide When Not In View:** If this is checked then the tooltips will be hidden when the headset is not looking at the controller.
  203. ### Class Events
  204. * `ControllerTooltipOn` - Emitted when the controller tooltip is turned on.
  205. * `ControllerTooltipOff` - Emitted when the controller tooltip is turned off.
  206. ### Unity Events
  207. Adding the `VRTK_ControllerTooltips_UnityEvents` component to `VRTK_ControllerTooltips` object allows access to `UnityEvents` that will react identically to the Class Events.
  208. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  209. ### Event Payload
  210. * `VRTK_ControllerTooltips.TooltipButtons element` - The tooltip element being affected.
  211. ### Class Methods
  212. #### ResetTooltip/0
  213. > `public virtual void ResetTooltip()`
  214. * Parameters
  215. * _none_
  216. * Returns
  217. * _none_
  218. The Reset method reinitalises the tooltips on all of the controller elements.
  219. #### UpdateText/2
  220. > `public virtual void UpdateText(TooltipButtons element, string newText)`
  221. * Parameters
  222. * `TooltipButtons element` - The specific controller element to change the tooltip text on.
  223. * `string newText` - A string containing the text to update the tooltip to display.
  224. * Returns
  225. * _none_
  226. The UpdateText method allows the tooltip text on a specific controller element to be updated at runtime.
  227. #### ToggleTips/2
  228. > `public virtual void ToggleTips(bool state, TooltipButtons element = TooltipButtons.None)`
  229. * Parameters
  230. * `bool state` - The state of whether to display or hide the controller tooltips, true will display and false will hide.
  231. * `TooltipButtons element` - The specific element to hide the tooltip on, if it is `TooltipButtons.None` then it will hide all tooltips. Optional parameter defaults to `TooltipButtons.None`
  232. * Returns
  233. * _none_
  234. The ToggleTips method will display the controller tooltips if the state is `true` and will hide the controller tooltips if the state is `false`. An optional `element` can be passed to target a specific controller tooltip to toggle otherwise all tooltips are toggled.
  235. ### Example
  236. `VRTK/Examples/029_Controller_Tooltips` displays two cubes that have an object tooltip added to them along with tooltips that have been added to the controllers.
  237. ---
  238. ## Snap Drop Zone (VRTK_SnapDropZone)
  239. ### Overview
  240. Provides a predefined zone where a valid interactable object can be dropped and upon dropping it snaps to the set snap drop zone transform position, rotation and scale.
  241. **Prefab Usage:**
  242. * Place the `VRTK/Prefabs/SnapDropZone/SnapDropZone` prefab into the scene hierarchy.
  243. * Provide the SnapDropZone with an optional `Highlight Object Prefab` to generate an object outline in the scene that determines the final position, rotation and scale of the snapped object.
  244. * If no `VRTK_BaseHighlighter` derivative is applied to the SnapDropZone then the default MaterialColorSwap Highlighter will be used.
  245. * The collision zone that activates the SnapDropZone is a `Sphere Collider` by default but can be amended or replaced on the SnapDropZone GameObject.
  246. * If the `Use Joint` Snap Type is selected then a custom Joint component is required to be added to the `SnapDropZone` Game Object and upon release the interactable object's rigidbody will be linked to this joint as the `Connected Body`.
  247. ### Inspector Parameters
  248. * **Highlight Object Prefab:** A game object that is used to draw the highlighted destination for within the drop zone. This object will also be created in the Editor for easy placement.
  249. * **Snap Type:** The Snap Type to apply when a valid interactable object is dropped within the snap zone.
  250. * **Snap Duration:** The amount of time it takes for the object being snapped to move into the new snapped position, rotation and scale.
  251. * **Apply Scaling On Snap:** If this is checked then the scaled size of the snap drop zone will be applied to the object that is snapped to it.
  252. * **Clone New On Unsnap:** If this is checked then when the snapped object is unsnapped from the drop zone, a clone of the unsnapped object will be snapped back into the drop zone.
  253. * **Highlight Color:** The colour to use when showing the snap zone is active. This is used as the highlight colour when no object is hovering but `Highlight Always Active` is true.
  254. * **Valid Highlight Color:** The colour to use when showing the snap zone is active and a valid object is hovering. If this is `Color.clear` then the `Highlight Color` will be used.
  255. * **Highlight Always Active:** The highlight object will always be displayed when the snap drop zone is available even if a valid item isn't being hovered over.
  256. * **Valid Object List Policy:** A specified VRTK_PolicyList to use to determine which interactable objects will be snapped to the snap drop zone on release.
  257. * **Display Drop Zone In Editor:** If this is checked then the drop zone highlight section will be displayed in the scene editor window.
  258. * **Default Snapped Interactable Object:** The Interactable Object to snap into the dropzone when the drop zone is enabled. The Interactable Object must be valid in any given policy list to snap.
  259. ### Class Variables
  260. * `public enum SnapTypes` - The types of snap on release available.
  261. * `UseKinematic` - Will set the interactable object rigidbody to `isKinematic = true`.
  262. * `UseJoint` - Will attach the interactable object's rigidbody to the provided joint as it's `Connected Body`.
  263. * `UseParenting` - Will set the SnapDropZone as the interactable object's parent and set it's rigidbody to `isKinematic = true`.
  264. ### Class Events
  265. * `ObjectEnteredSnapDropZone` - Emitted when a valid interactable object enters the snap drop zone trigger collider.
  266. * `ObjectExitedSnapDropZone` - Emitted when a valid interactable object exists the snap drop zone trigger collider.
  267. * `ObjectSnappedToDropZone` - Emitted when an interactable object is successfully snapped into a drop zone.
  268. * `ObjectUnsnappedFromDropZone` - Emitted when an interactable object is removed from a snapped drop zone.
  269. ### Unity Events
  270. Adding the `VRTK_SnapDropZone_UnityEvents` component to `VRTK_SnapDropZone` object allows access to `UnityEvents` that will react identically to the Class Events.
  271. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  272. ### Event Payload
  273. * `GameObject snappedObject` - The interactable object that is dealing with the snap drop zone.
  274. ### Class Methods
  275. #### InitaliseHighlightObject/1
  276. > `public virtual void InitaliseHighlightObject(bool removeOldObject = false)`
  277. * Parameters
  278. * `bool removeOldObject` - If this is set to true then it attempts to delete the old highlight object if it exists. Defaults to `false`
  279. * Returns
  280. * _none_
  281. The InitaliseHighlightObject method sets up the highlight object based on the given Highlight Object Prefab.
  282. #### ForceSnap/1
  283. > `public virtual void ForceSnap(GameObject objectToSnap)`
  284. * Parameters
  285. * `GameObject objectToSnap` - The GameObject to attempt to snap.
  286. * Returns
  287. * _none_
  288. the ForceSnap method attempts to automatically attach a valid GameObject to the snap drop zone.
  289. #### ForceUnsnap/0
  290. > `public virtual void ForceUnsnap()`
  291. * Parameters
  292. * _none_
  293. * Returns
  294. * _none_
  295. The ForceUnsnap method attempts to automatically remove the current snapped game object from the snap drop zone.
  296. #### ValidSnappableObjectIsHovering/0
  297. > `public virtual bool ValidSnappableObjectIsHovering()`
  298. * Parameters
  299. * _none_
  300. * Returns
  301. * `bool` - Returns true if a valid object is currently in the snap drop zone area.
  302. The ValidSnappableObjectIsHovering method determines if any valid objects are currently hovering in the snap drop zone area.
  303. #### IsObjectHovering/1
  304. > `public virtual bool IsObjectHovering(GameObject checkObject)`
  305. * Parameters
  306. * `GameObject checkObject` - The GameObject to check to see if it's hovering in the snap drop zone area.
  307. * Returns
  308. * `bool` - Returns true if the given GameObject is hovering (but not snapped) in the snap drop zone area.
  309. The IsObjectHovering method determines if the given GameObject is currently howvering (but not snapped) in the snap drop zone area.
  310. #### IsInteractableObjectHovering/1
  311. > `public virtual bool IsInteractableObjectHovering(VRTK_InteractableObject checkObject)`
  312. * Parameters
  313. * `VRTK_InteractableObject checkObject` - The Interactable Object script to check to see if it's hovering in the snap drop zone area.
  314. * Returns
  315. * `bool` - Returns true if the given Interactable Object script is hovering (but not snapped) in the snap drop zone area.
  316. The IsInteractableObjectHovering method determines if the given Interactable Object script is currently howvering (but not snapped) in the snap drop zone area.
  317. #### GetHoveringObjects/0
  318. > `public virtual List<GameObject> GetHoveringObjects()`
  319. * Parameters
  320. * _none_
  321. * Returns
  322. * `List<GameObject>` - The List of valid GameObjects that are hovering (but not snapped) in the snap drop zone area.
  323. The GetHoveringObjects method returns a List of valid GameObjects that are currently hovering (but not snapped) in the snap drop zone area.
  324. #### GetHoveringInteractableObjects/0
  325. > `public virtual List<VRTK_InteractableObject> GetHoveringInteractableObjects()`
  326. * Parameters
  327. * _none_
  328. * Returns
  329. * `List<VRTK_InteractableObject>` - The List of valid Interactable Object scripts that are hovering (but not snapped) in the snap drop zone area.
  330. The GetHoveringInteractableObjects method returns a List of valid Interactable Object scripts that are currently hovering (but not snapped) in the snap drop zone area.
  331. #### GetCurrentSnappedObject/0
  332. > `public virtual GameObject GetCurrentSnappedObject()`
  333. * Parameters
  334. * _none_
  335. * Returns
  336. * `GameObject` - The GameObject that is currently snapped in the snap drop zone area.
  337. The GetCurrentSnappedObejct method returns the GameObject that is currently snapped in the snap drop zone area.
  338. #### GetCurrentSnappedInteractableObject/0
  339. > `public virtual VRTK_InteractableObject GetCurrentSnappedInteractableObject()`
  340. * Parameters
  341. * _none_
  342. * Returns
  343. * `VRTK_InteractableObject` - The Interactable Object script that is currently snapped in the snap drop zone area.
  344. The GetCurrentSnappedInteractableObject method returns the Interactable Object script that is currently snapped in the snap drop zone area.
  345. #### Clone/1
  346. > `public virtual GameObject Clone(Vector3 position)`
  347. * Parameters
  348. * `Vector3 position` - Position of the cloned GameObject
  349. * Returns
  350. * `GameObject` - The GameObject of the clone
  351. The Clone method returns the GameObject of the cloned snap drop zone
  352. #### Clone/0
  353. > `public virtual GameObject Clone()`
  354. * Parameters
  355. * _none_
  356. * Returns
  357. * `GameObject` - The GameObject of the clone
  358. The Clone method returns the GameObject of the cloned snap drop zone
  359. ### Example
  360. `VRTK/Examples/041_Controller_ObjectSnappingToDropZones` uses the `VRTK_SnapDropZone` prefab to set up pre-determined snap zones for a range of objects and demonstrates how only objects of certain types can be snapped into certain areas.
  361. ---
  362. ## Destination Point (VRTK_DestinationPoint)
  363. > extends [VRTK_DestinationMarker](#destination-marker-vrtk_destinationmarker)
  364. ### Overview
  365. Allows for a specific scene marker or specific area within the scene that can be teleported to.
  366. **Prefab Usage:**
  367. * Place the `VRTK/Prefabs/DestinationPoint/DestinationPoint` prefab at the desired location within the scene.
  368. * Uncheck the `Enable Teleport` checkbox to lock the destination point and prevent teleporting to it.
  369. * Uncheck the `Snap To Point` checkbox to provide a destination area rather than a specific point to teleport to.
  370. ### Inspector Parameters
  371. * **Default Cursor Object:** The GameObject to use to represent the default cursor state.
  372. * **Hover Cursor Object:** The GameObject to use to represent the hover cursor state.
  373. * **Locked Cursor Object:** The GameObject to use to represent the locked cursor state.
  374. * **Destination Location:** An optional transform to determine the destination location for the destination marker. This can be useful to offset the destination location from the destination point. If this is left empty then the destiantion point transform will be used.
  375. * **Snap To Point:** If this is checked then after teleporting, the play area will be snapped to the origin of the destination point. If this is false then it's possible to teleport to anywhere within the destination point collider.
  376. * **Hide Pointer Cursor On Hover:** If this is checked, then the pointer cursor will be hidden when a valid destination point is hovered over.
  377. * **Hide Direction Indicator On Hover:** If this is checked, then the pointer direction indicator will be hidden when a valid destination point is hovered over. A pointer direction indicator will always be hidden if snap to rotation is set.
  378. * **Snap To Rotation:** Determines if the play area will be rotated to the rotation of the destination point upon the destination marker being set.
  379. * **Teleporter:** The scene teleporter that is used. If this is not specified then it will be auto looked up in the scene.
  380. ### Class Variables
  381. * `public enum RotationTypes` - Allowed snap to rotation types.
  382. * `NoRotation` - No rotation information will be emitted in the destination set payload.
  383. * `RotateWithNoHeadsetOffset` - The destination point's rotation will be emitted without taking into consideration the current headset rotation.
  384. * `RotateWithHeadsetOffset` - The destination point's rotation will be emitted and will take into consideration the current headset rotation.
  385. ### Class Events
  386. * `DestinationPointEnabled` - Emitted when the destination point is enabled.
  387. * `DestinationPointDisabled` - Emitted when the destination point is disabled.
  388. * `DestinationPointLocked` - Emitted when the destination point is locked.
  389. * `DestinationPointUnlocked` - Emitted when the destination point is unlocked.
  390. * `DestinationPointReset` - Emitted when the destination point is reset.
  391. ### Unity Events
  392. Adding the `VRTK_DestinationPoint_UnityEvents` component to `VRTK_DestinationPoint` object allows access to `UnityEvents` that will react identically to the Class Events.
  393. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  394. ### Class Methods
  395. #### ResetDestinationPoint/0
  396. > `public virtual void ResetDestinationPoint()`
  397. * Parameters
  398. * _none_
  399. * Returns
  400. * _none_
  401. The ResetDestinationPoint resets the destination point back to the default state.
  402. ### Example
  403. `044_CameraRig_RestrictedTeleportZones` uses the `VRTK_DestinationPoint` prefab to set up a collection of pre-defined teleport locations.
  404. ---
  405. ## Pointer Direction Indicator (VRTK_PointerDirectionIndicator)
  406. ### Overview
  407. Adds a Pointer Direction Indicator to a pointer renderer and determines a given world rotation that can be used by a Destiantion Marker.
  408. **Prefab Usage:**
  409. * Place the `VRTK/Prefabs/PointerDirectionIndicator/PointerDirectionIndicator` prefab into the scene hierarchy.
  410. * Attach the `PointerDirectionIndicator` scene GameObejct to the `Direction Indicator` inspector parameter on a `VRTK_BasePointerRenderer` component.
  411. > This can be useful for rotating the play area upon teleporting to face the user in a new direction without expecting them to physically turn in the play space.
  412. ### Inspector Parameters
  413. * **Touchpad Deadzone:** The touchpad axis needs to be above this deadzone for it to register as a valid touchpad angle.
  414. * **Coordinate Axis:** The axis to use for the direction coordinates.
  415. * **Include Headset Offset:** If this is checked then the reported rotation will include the offset of the headset rotation in relation to the play area.
  416. * **Display On Invalid Location:** If this is checked then the direction indicator will be displayed when the location is invalid.
  417. * **Use Pointer Color:** If this is checked then the pointer valid/invalid colours will also be used to change the colour of the direction indicator.
  418. * **Indicator Visibility:** Determines when the direction indicator will be visible.
  419. ### Class Variables
  420. * `public enum VisibilityState` - States of Direction Indicator Visibility.
  421. * `OnWhenPointerActive` - Only shows the direction indicator when the pointer is active.
  422. * `AlwaysOnWithPointerCursor` - Only shows the direction indicator when the pointer cursor is visible or if the cursor is hidden and the pointer is active.
  423. ### Class Events
  424. * `PointerDirectionIndicatorPositionSet` - Emitted when the object tooltip is reset.
  425. ### Unity Events
  426. Adding the `VRTK_PointerDirectionIndicator_UnityEvents` component to `VRTK_PointerDirectionIndicator` object allows access to `UnityEvents` that will react identically to the Class Events.
  427. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  428. ### Class Methods
  429. #### Initialize/1
  430. > `public virtual void Initialize(VRTK_ControllerEvents events)`
  431. * Parameters
  432. * `VRTK_ControllerEvents events` - The Controller Events script that is used to control the direction indicator's rotation.
  433. * Returns
  434. * _none_
  435. The Initialize method is used to set up the direction indicator.
  436. #### SetPosition/2
  437. > `public virtual void SetPosition(bool active, Vector3 position)`
  438. * Parameters
  439. * `bool active` - Determines if the direction indicator GameObject should be active or not.
  440. * `Vector3 position` - The position to set the direction indicator to.
  441. * Returns
  442. * _none_
  443. The SetPosition method is used to set the world position of the direction indicator.
  444. #### GetRotation/0
  445. > `public virtual Quaternion GetRotation()`
  446. * Parameters
  447. * _none_
  448. * Returns
  449. * `Quaternion` - The reported rotation of the direction indicator.
  450. The GetRotation method returns the current reported rotation of the direction indicator.
  451. #### SetMaterialColor/2
  452. > `public virtual void SetMaterialColor(Color color, bool validity)`
  453. * Parameters
  454. * `Color color` - The colour to update the direction indicatormaterial to.
  455. * `bool validity` - Determines if the colour being set is based from a valid location or invalid location.
  456. * Returns
  457. * _none_
  458. The SetMaterialColor method sets the current material colour on the direction indicator.
  459. #### GetControllerEvents/0
  460. > `public virtual VRTK_ControllerEvents GetControllerEvents()`
  461. * Parameters
  462. * _none_
  463. * Returns
  464. * `VRTK_ControllerEvents` - The associated Controller Events script.
  465. The GetControllerEvents method returns the associated Controller Events script with the Pointer Direction Indicator script.
  466. ---
  467. ## Radial Menu (VRTK_RadialMenu)
  468. ### Overview
  469. Provides a UI element into the world space that can be dropped into a Controller GameObject and used to create and use Radial Menus from the touchpad.
  470. **Prefab Usage:**
  471. * Place the `VRTK/Prefabs/RadialMenu/RadialMenu` prefab as a child of a Controller script alias GameObject.
  472. ### Inspector Parameters
  473. * **Buttons:** An array of Buttons that define the interactive buttons required to be displayed as part of the radial menu.
  474. * **Button Prefab:** The base for each button in the menu, by default set to a dynamic circle arc that will fill up a portion of the menu.
  475. * **Generate On Awake:** If checked, then the buttons will be auto generated on awake.
  476. * **Button Thickness:** Percentage of the menu the buttons should fill, 1.0 is a pie slice, 0.1 is a thin ring.
  477. * **Button Color:** The background colour of the buttons, default is white.
  478. * **Offset Distance:** The distance the buttons should move away from the centre. This creates space between the individual buttons.
  479. * **Offset Rotation:** The additional rotation of the Radial Menu.
  480. * **Rotate Icons:** Whether button icons should rotate according to their arc or be vertical compared to the controller.
  481. * **Icon Margin:** The margin in pixels that the icon should keep within the button.
  482. * **Is Shown:** Whether the buttons are shown
  483. * **Hide On Release:** Whether the buttons should be visible when not in use.
  484. * **Execute On Unclick:** Whether the button action should happen when the button is released, as opposed to happening immediately when the button is pressed.
  485. * **Base Haptic Strength:** The base strength of the haptic pulses when the selected button is changed, or a button is pressed. Set to zero to disable.
  486. * **Dead Zone:** The dead zone in the middle of the dial where the menu does not consider a button is selected. Set to zero to disable.
  487. * **Menu Buttons:** The actual GameObjects that make up the radial menu.
  488. ### Class Methods
  489. #### TouchAngleDeflection/2
  490. > `public TouchAngleDeflection(float angle, float deflection)`
  491. * Parameters
  492. * `float angle` - The angle of the touch on the radial menu.
  493. * `float deflection` - Deflection of the touch, where 0 is the centre and 1 is the edge.
  494. * Returns
  495. * _none_
  496. Constructs an object to hold the angle and deflection of the user's touch on the touchpad
  497. #### HoverButton/1
  498. > `public virtual void HoverButton(TouchAngleDeflection givenTouchAngleDeflection)`
  499. * Parameters
  500. * `TouchAngleDeflection givenTouchAngleDeflection` - The angle and deflection on the radial menu.
  501. * Returns
  502. * _none_
  503. The HoverButton method is used to set the button hover at a given angle and deflection.
  504. #### ClickButton/1
  505. > `public virtual void ClickButton(TouchAngleDeflection givenTouchAngleDeflection)`
  506. * Parameters
  507. * `TouchAngleDeflection givenTouchAngleDeflection` - The angle and deflection on the radial menu.
  508. * Returns
  509. * _none_
  510. The ClickButton method is used to set the button click at a given angle and deflection.
  511. #### UnClickButton/1
  512. > `public virtual void UnClickButton(TouchAngleDeflection givenTouchAngleDeflection)`
  513. * Parameters
  514. * `TouchAngleDeflection givenTouchAngleDeflection` - The angle and deflection on the radial menu.
  515. * Returns
  516. * _none_
  517. The UnClickButton method is used to set the button unclick at a given angle and deflection.
  518. #### ToggleMenu/0
  519. > `public virtual void ToggleMenu()`
  520. * Parameters
  521. * _none_
  522. * Returns
  523. * _none_
  524. The ToggleMenu method is used to show or hide the radial menu.
  525. #### StopTouching/0
  526. > `public virtual void StopTouching()`
  527. * Parameters
  528. * _none_
  529. * Returns
  530. * _none_
  531. The StopTouching method is used to stop touching the menu.
  532. #### ShowMenu/0
  533. > `public virtual void ShowMenu()`
  534. * Parameters
  535. * _none_
  536. * Returns
  537. * _none_
  538. The ShowMenu method is used to show the menu.
  539. #### GetButton/1
  540. > `public virtual RadialMenuButton GetButton(int id)`
  541. * Parameters
  542. * `int id` - The id of the button to retrieve.
  543. * Returns
  544. * `RadialMenuButton` - The found radial menu button.
  545. The GetButton method is used to get a button from the menu.
  546. #### HideMenu/1
  547. > `public virtual void HideMenu(bool force)`
  548. * Parameters
  549. * `bool force` - If true then the menu is always hidden.
  550. * Returns
  551. * _none_
  552. The HideMenu method is used to hide the menu.
  553. #### RegenerateButtons/0
  554. > `public void RegenerateButtons()`
  555. * Parameters
  556. * _none_
  557. * Returns
  558. * _none_
  559. The RegenerateButtons method creates all the button arcs and populates them with desired icons.
  560. #### AddButton/1
  561. > `public void AddButton(RadialMenuButton newButton)`
  562. * Parameters
  563. * `RadialMenuButton newButton` - The button to add.
  564. * Returns
  565. * _none_
  566. The AddButton method is used to add a new button to the menu.
  567. ### Example
  568. `VRTK/Examples/030_Controls_RadialTouchpadMenu` displays a radial menu for each controller. The left controller uses the `Hide On Release` variable, so it will only be visible if the left touchpad is being touched. It also uses the `Execute On Unclick` variable to delay execution until the touchpad button is unclicked. The example scene also contains a demonstration of anchoring the RadialMenu to an interactable cube instead of a controller.
  569. ---
  570. ## Independent Radial Menu (VRTK_IndependentRadialMenuController)
  571. > extends VRTK_RadialMenuController
  572. ### Overview
  573. Allows the RadialMenu to be anchored to any object, not just a controller.
  574. **Prefab Usage:**
  575. * Place the `VRTK/Prefabs/RadialMenu/RadialMenu` prefab as a child of the GameObject to associate the Radial Menu with.
  576. * Position and scale the menu by adjusting the transform of the `RadialMenu` empty.
  577. * Replace `VRTK_RadialMenuController` with `VRTK_IndependentRadialMenuController` that is located on the `RadialMenu/RadialMenuUI/Panel` GameObject.
  578. * Ensure the parent object has the `VRTK_InteractableObject` script.
  579. * Verify that `Is Usable` and `Hold Button to Use` are both checked on the `VRTK_InteractableObject`.
  580. * Attach `VRTK_InteractTouch` and `VRTK_InteractUse` scripts to the objects that will activate the Radial Menu (e.g. the Controllers).
  581. ### Inspector Parameters
  582. * **Events Manager:** If the RadialMenu is the child of an object with VRTK_InteractableObject attached, this will be automatically obtained. It can also be manually set.
  583. * **Add Menu Collider:** Whether or not the script should dynamically add a SphereCollider to surround the menu.
  584. * **Collider Radius Multiplier:** This times the size of the RadialMenu is the size of the collider.
  585. * **Hide After Execution:** If true, after a button is clicked, the RadialMenu will hide.
  586. * **Offset Multiplier:** How far away from the object the menu should be placed, relative to the size of the RadialMenu.
  587. * **Rotate Towards:** The object the RadialMenu should face towards. If left empty, it will automatically try to find the Headset Camera.
  588. ### Class Methods
  589. #### UpdateEventsManager/0
  590. > `public virtual void UpdateEventsManager()`
  591. * Parameters
  592. * _none_
  593. * Returns
  594. * _none_
  595. The UpdateEventsManager method is used to update the events within the menu controller.
  596. ### Example
  597. `VRTK/Examples/030_Controls_RadialTouchpadMenu` displays a radial menu for each controller. The left controller uses the `Hide On Release` variable, so it will only be visible if the left touchpad is being touched. It also uses the `Execute On Unclick` variable to delay execution until the touchpad button is unclicked. The example scene also contains a demonstration of anchoring the RadialMenu to an interactable cube instead of a controller.
  598. ---
  599. ## Panel Menu (VRTK_PanelMenuController)
  600. ### Overview
  601. Adds a top-level controller to handle the display of up to four child PanelMenuItemController items which are displayed as a canvas UI panel.
  602. **Prefab Usage:**
  603. * Place the `VRTK/Prefabs/PanelMenu/PanelMenu` prefab as a child of the `VRTK_InteractableObject` the panel menu is for.
  604. * Optionally remove the panel control menu item child GameObjects if they are not required, e.g. `PanelTopControls`.
  605. * Set the panel menu item controllers on the `VRTK_PanelMenuController` script to determine which panel control menu items are available.
  606. * The available panel control menu items can be activated by pressing the corresponding direction on the touchpad.
  607. ### Inspector Parameters
  608. * **Rotate Towards:** The GameObject the panel should rotate towards, which is the Camera (eye) by default.
  609. * **Zoom Scale Multiplier:** The scale multiplier, which relates to the scale of parent interactable object.
  610. * **Top Panel Menu Item Controller:** The top PanelMenuItemController, which is triggered by pressing up on the controller touchpad.
  611. * **Bottom Panel Menu Item Controller:** The bottom PanelMenuItemController, which is triggered by pressing down on the controller touchpad.
  612. * **Left Panel Menu Item Controller:** The left PanelMenuItemController, which is triggered by pressing left on the controller touchpad.
  613. * **Right Panel Menu Item Controller:** The right PanelMenuItemController, which is triggered by pressing right on the controller touchpad.
  614. ### Class Methods
  615. #### ToggleMenu/0
  616. > `public virtual void ToggleMenu()`
  617. * Parameters
  618. * _none_
  619. * Returns
  620. * _none_
  621. The ToggleMenu method is used to show or hide the menu.
  622. #### ShowMenu/0
  623. > `public virtual void ShowMenu()`
  624. * Parameters
  625. * _none_
  626. * Returns
  627. * _none_
  628. The ShowMenu method is used to show the menu.
  629. #### HideMenu/1
  630. > `public virtual void HideMenu(bool force)`
  631. * Parameters
  632. * `bool force` - If true then the menu is always hidden.
  633. * Returns
  634. * _none_
  635. The HideMenu method is used to hide the menu.
  636. #### HideMenuImmediate/0
  637. > `public virtual void HideMenuImmediate()`
  638. * Parameters
  639. * _none_
  640. * Returns
  641. * _none_
  642. The HideMenuImmediate method is used to immediately hide the menu.
  643. ### Example
  644. `040_Controls_Panel_Menu` contains three basic interactive object examples of the PanelMenu in use.
  645. ---
  646. ## Panel Menu Item (VRTK_PanelMenuItemController)
  647. ### Overview
  648. Intercepts the controller events sent from a `VRTK_PanelMenuController` and passes them onto additional custom event subscriber scripts, which then carry out the required custom UI actions.
  649. > This script is not directly part of a prefab but is a helper associated to the `PanelMenu` prefab.
  650. * Place the `VRTK/Prefabs/PanelMenu/VRTK_PanelMenuItemController` script on the child GameObject of any Panel Item Container which is contained within the `PanelMenuController` prefab within the scene.
  651. * Pick up the VRTK_InteractableObject show/hide the panel menu by pressing the touchpad top/bottom/left/right you can open/close the child UI panel that has been assigned via the Unity Editor panel.
  652. ### Class Events
  653. * `PanelMenuItemShowing` - Emitted when the panel menu item is showing.
  654. * `PanelMenuItemHiding` - Emitted when the panel menu item is hiding.
  655. * `PanelMenuItemSwipeLeft` - Emitted when the panel menu item is open and the user swipes left on the controller touchpad.
  656. * `PanelMenuItemSwipeRight` - Emitted when the panel menu item is open and the user swipes right on the controller touchpad.
  657. * `PanelMenuItemSwipeTop` - Emitted when the panel menu item is open and the user swipes top on the controller touchpad.
  658. * `PanelMenuItemSwipeBottom` - Emitted when the panel menu item is open and the user swipes bottom on the controller touchpad.
  659. * `PanelMenuItemTriggerPressed` - Emitted when the panel menu item is open and the user presses the trigger of the controller holding the interactable object.
  660. ### Event Payload
  661. * `GameObject interactableObject` - The GameObject for the interactable object the PanelMenu is attached to.
  662. ### Class Methods
  663. #### SetPanelMenuItemEvent/1
  664. > `public virtual PanelMenuItemControllerEventArgs SetPanelMenuItemEvent(GameObject interactableObject)`
  665. * Parameters
  666. * `GameObject interactableObject` - The object the menu is attached to.
  667. * Returns
  668. * `PanelMenuItemControllerEventArgs` - The payload for the event.
  669. The SetPanelMenuItemEvent is used to build up the event payload.
  670. #### Show/1
  671. > `public virtual void Show(GameObject interactableObject)`
  672. * Parameters
  673. * `GameObject interactableObject` - The object the menu is attached to.
  674. * Returns
  675. * _none_
  676. The Show method is used to show the menu.
  677. #### Hide/1
  678. > `public virtual void Hide(GameObject interactableObject)`
  679. * Parameters
  680. * `GameObject interactableObject` - The object the menu is attached to.
  681. * Returns
  682. * _none_
  683. The Hide method is used to show the menu.
  684. #### SwipeLeft/1
  685. > `public virtual void SwipeLeft(GameObject interactableObject)`
  686. * Parameters
  687. * `GameObject interactableObject` - The object the menu is attached to.
  688. * Returns
  689. * _none_
  690. The SwipeLeft method is used when the control is swiped left.
  691. #### SwipeRight/1
  692. > `public virtual void SwipeRight(GameObject interactableObject)`
  693. * Parameters
  694. * `GameObject interactableObject` - The object the menu is attached to.
  695. * Returns
  696. * _none_
  697. The SwipeRight method is used when the control is swiped right.
  698. #### SwipeTop/1
  699. > `public virtual void SwipeTop(GameObject interactableObject)`
  700. * Parameters
  701. * `GameObject interactableObject` - The object the menu is attached to.
  702. * Returns
  703. * _none_
  704. The SwipeTop method is used when the control is swiped up.
  705. #### SwipeBottom/1
  706. > `public virtual void SwipeBottom(GameObject interactableObject)`
  707. * Parameters
  708. * `GameObject interactableObject` - The object the menu is attached to.
  709. * Returns
  710. * _none_
  711. The SwipeBottom method is used when the control is swiped down.
  712. #### TriggerPressed/1
  713. > `public virtual void TriggerPressed(GameObject interactableObject)`
  714. * Parameters
  715. * `GameObject interactableObject` - The object the menu is attached to.
  716. * Returns
  717. * _none_
  718. The TriggerPressed method is used when the control action button is pressed.
  719. ### Example
  720. `040_Controls_Panel_Menu` contains three basic interactive object examples of the PanelMenu in use.
  721. ---
  722. ## Avatar Hands (VRTK_AvatarHandController)
  723. ### Overview
  724. Provides a custom controller hand model with psuedo finger functionality.
  725. **Prefab Usage:**
  726. * Place the `VRTK/Prefabs/AvatarHands/BasicHands/VRTK_BasicHand` prefab as a child of either the left or right script alias.
  727. * If the prefab is being used in the left hand then check the `Mirror Model` parameter.
  728. * By default, the avatar hand controller will detect which controller is connected and represent it accordingly.
  729. * Optionally, use SDKTransformModify scripts to adjust the hand orientation based on different controller types.
  730. ### Inspector Parameters
  731. * **Ignore All Overrides:** Determines whether to ignore all of the given overrides on an Interaction event.
  732. * **State Value:** Sets the Animation parameter for the interaction type and can be used to change the Idle pose based on interaction type.
  733. * **Apply Thumb Override:** Determines when to apply the given thumb override.
  734. * **Thumb Override:** The axis override for the thumb on an Interact Touch event. Will only be applicable if the thumb button state is not touched.
  735. * **Apply Index Override:** Determines when to apply the given index finger override.
  736. * **Index Override:** The axis override for the index finger on an Interact Touch event. Will only be applicable if the index finger button state is not touched.
  737. * **Apply Middle Override:** Determines when to apply the given middle finger override.
  738. * **Middle Override:** The axis override for the middle finger on an Interact Touch event. Will only be applicable if the middle finger button state is not touched.
  739. * **Apply Ring Override:** Determines when to apply the given ring finger override.
  740. * **Ring Override:** The axis override for the ring finger on an Interact Touch event. Will only be applicable if the ring finger button state is not touched.
  741. * **Apply Pinky Override:** Determines when to apply the given pinky finger override.
  742. * **Pinky Override:** The axis override for the pinky finger on an Interact Touch event. Will only be applicable if the pinky finger button state is not touched.
  743. * **Controller Type:** The controller type to use for default finger settings.
  744. * **Set Fingers For Controller Type:** Determines whether the Finger and State settings are auto set based on the connected controller type.
  745. * **Mirror Model:** If this is checked then the model will be mirrored, tick this if the avatar hand is for the left hand controller.
  746. * **Animation Snap Speed:** The speed in which a finger will transition to it's destination position if the finger state is `Digital`.
  747. * **Thumb Button:** The button alias to control the thumb if the thumb state is `Digital`.
  748. * **Index Button:** The button alias to control the index finger if the index finger state is `Digital`.
  749. * **Middle Button:** The button alias to control the middle finger if the middle finger state is `Digital`.
  750. * **Ring Button:** The button alias to control the ring finger if the ring finger state is `Digital`.
  751. * **Pinky Button:** The button alias to control the pinky finger if the pinky finger state is `Digital`.
  752. * **Three Finger Button:** The button alias to control the middle, ring and pinky finger if the three finger state is `Digital`.
  753. * **Thumb Axis Button:** The button type to listen for axis changes to control the thumb.
  754. * **Index Axis Button:** The button type to listen for axis changes to control the index finger.
  755. * **Middle Axis Button:** The button type to listen for axis changes to control the middle finger.
  756. * **Ring Axis Button:** The button type to listen for axis changes to control the ring finger.
  757. * **Pinky Axis Button:** The button type to listen for axis changes to control the pinky finger.
  758. * **Three Finger Axis Button:** The button type to listen for axis changes to control the middle, ring and pinky finger.
  759. * **Thumb State:** The Axis Type to utilise when dealing with the thumb state. Not all controllers support all axis types on all of the available buttons.
  760. * **Near Touch Overrides:** Finger axis overrides on an Interact NearTouch event.
  761. * **Touch Overrides:** Finger axis overrides on an Interact Touch event.
  762. * **Grab Overrides:** Finger axis overrides on an Interact Grab event.
  763. * **Use Overrides:** Finger axis overrides on an Interact Use event.
  764. * **Hand Model:** The Transform that contains the avatar hand model. If this is left blank then a child GameObject named `Model` will be searched for to use as the Transform.
  765. * **Controller Events:** The controller to listen for the events on. If this is left blank as it will be auto populated by finding the Controller Events script on the parent GameObject.
  766. * **Interact Near Touch:** An optional Interact NearTouch to listen for near touch events on. If this is left blank as it will attempt to be auto populated by finding the Interact NearTouch script on the parent GameObject.
  767. * **Interact Touch:** An optional Interact Touch to listen for touch events on. If this is left blank as it will attempt to be auto populated by finding the Interact Touch script on the parent GameObject.
  768. * **Interact Grab:** An optional Interact Grab to listen for grab events on. If this is left blank as it will attempt to be auto populated by finding the Interact Grab script on the parent GameObject.
  769. * **Interact Use:** An optional Interact Use to listen for use events on. If this is left blank as it will attempt to be auto populated by finding the Interact Use script on the parent GameObject.
  770. ### Class Variables
  771. * `public enum ApplyOverrideType` - Determine when to apply the override.
  772. * `Never` - Never apply the override.
  773. * `Always` - Always apply the override.
  774. * `DigitalState` - Only apply the override when the state is set to digital.
  775. * `AxisState` - Only apply the override when the state is set to axis.
  776. * `SenseAxisState` - Only apply the override when the state is set to sense axis.
  777. * `AxisAndSenseAxisState` - Only apply the override when the state is set to axis or sense axis.
  778. ### Example
  779. `032_Controller_CustomControllerModel` uses the `VRTK_BasicHand` prefab to display custom avatar hands for the left and right controller.
  780. ---
  781. # Pointers (VRTK/Source/Scripts/Pointers)
  782. A collection of scripts that provide the ability to create pointers and set destination markers in the scene.
  783. * [Destination Marker](#destination-marker-vrtk_destinationmarker)
  784. * [Pointer](#pointer-vrtk_pointer)
  785. * [Play Area Cursor](#play-area-cursor-vrtk_playareacursor)
  786. ---
  787. ## Destination Marker (VRTK_DestinationMarker)
  788. ### Overview
  789. Provides a base that all destination markers can inherit from.
  790. **Script Usage:**
  791. > This is an abstract class that is to be inherited to a concrete class that provides object control action functionality, therefore this script should not be directly used.
  792. ### Inspector Parameters
  793. * **Enable Teleport:** If this is checked then the teleport flag is set to true in the Destination Set event so teleport scripts will know whether to action the new destination.
  794. * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether destination targets will be considered valid or invalid.
  795. ### Class Events
  796. * `DestinationMarkerEnter` - Emitted when a collision with another collider has first occurred.
  797. * `DestinationMarkerExit` - Emitted when the collision with the other collider ends.
  798. * `DestinationMarkerSet` - Emitted when the destination marker is active in the scene to determine the last destination position (useful for selecting and teleporting).
  799. ### Unity Events
  800. Adding the `VRTK_DestinationMarker_UnityEvents` component to `VRTK_DestinationMarker` object allows access to `UnityEvents` that will react identically to the Class Events.
  801. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  802. ### Event Payload
  803. * `float distance` - The distance between the origin and the collided destination.
  804. * `Transform target` - The Transform of the collided destination object.
  805. * `RaycastHit raycastHit` - The optional RaycastHit generated from when the ray collided.
  806. * `Vector3 destinationPosition` - The world position of the destination marker.
  807. * `Quaternion? destinationRotation` - The world rotation of the destination marker.
  808. * `bool forceDestinationPosition` - If true then the given destination position should not be altered by anything consuming the payload.
  809. * `bool enableTeleport` - Whether the destination set event should trigger teleport.
  810. * `VRTK_ControllerReference controllerReference` - The optional reference to the controller controlling the destination marker.
  811. ### Class Methods
  812. #### SetNavMeshData/1
  813. > `public virtual void SetNavMeshData(VRTK_NavMeshData givenData)`
  814. * Parameters
  815. * `VRTK_NavMeshData givenData` - The NavMeshData object that contains the NavMesh restriction settings.
  816. * Returns
  817. * _none_
  818. The SetNavMeshData method is used to limit the destination marker to the scene NavMesh based on the settings in the given NavMeshData object.
  819. #### SetHeadsetPositionCompensation/1
  820. > `public virtual void SetHeadsetPositionCompensation(bool state)`
  821. * Parameters
  822. * `bool state` - The state of whether to take the position of the headset within the play area into account when setting the destination marker.
  823. * Returns
  824. * _none_
  825. The SetHeadsetPositionCompensation method determines whether the offset position of the headset from the centre of the play area should be taken into consideration when setting the destination marker. If `true` then it will take the offset position into consideration.
  826. #### SetForceHoverOnRepeatedEnter/1
  827. > `public virtual void SetForceHoverOnRepeatedEnter(bool state)`
  828. * Parameters
  829. * `bool state` - The state of whether to force the hover on or off.
  830. * Returns
  831. * _none_
  832. The SetForceHoverOnRepeatedEnter method is used to set whether the Enter event will forciably call the Hover event if the existing colliding object is the same as it was the previous enter call.
  833. ---
  834. ## Pointer (VRTK_Pointer)
  835. > extends [VRTK_DestinationMarker](#destination-marker-vrtk_destinationmarker)
  836. ### Overview
  837. Provides a basis of being able to emit a pointer from a specified GameObject.
  838. **Required Components:**
  839. * `VRTK_BasePointerRenderer` - The visual representation of the pointer when activated.
  840. **Optional Components:**
  841. * `VRTK_ControllerEvents` - The events component to listen for the button presses on. This must be applied on the same GameObject as this script if one is not provided via the `Controller` parameter.
  842. * `VRTK_InteractUse` - The use component to utilise when the pointer is to activate the use action on an Interactable Object. This must be applied on the same GameObject as this script if one is not provided via the `Interact Use` parameter.
  843. **Script Usage:**
  844. * Place the `VRTK_Pointer` script on either:
  845. * The controller script alias GameObject of the controller to emit the pointer from (e.g. Right Controller Script Alias).
  846. * Any other scene GameObject and provide a valid `Transform` component to the `Custom Origin` parameter of this script. This does not have to be a controller and can be any GameObject that will emit the pointer.
  847. * Link the required Base Pointer Renderer script to the `Pointer Renderer` parameter of this script.
  848. ### Inspector Parameters
  849. * **Pointer Renderer:** The specific renderer to use when the pointer is activated. The renderer also determines how the pointer reaches it's destination (e.g. straight line, bezier curve).
  850. * **Activation Button:** The button used to activate/deactivate the pointer.
  851. * **Hold Button To Activate:** If this is checked then the Activation Button needs to be continuously held down to keep the pointer active. If this is unchecked then the Activation Button works as a toggle, the first press/release enables the pointer and the second press/release disables the pointer.
  852. * **Activate On Enable:** If this is checked then the pointer will be toggled on when the script is enabled.
  853. * **Activation Delay:** The time in seconds to delay the pointer being able to be active again.
  854. * **Selection Button:** The button used to execute the select action at the pointer's target position.
  855. * **Select On Press:** If this is checked then the pointer selection action is executed when the Selection Button is pressed down. If this is unchecked then the selection action is executed when the Selection Button is released.
  856. * **Selection Delay:** The time in seconds to delay the pointer being able to execute the select action again.
  857. * **Select After Hover Duration:** The amount of time the pointer can be over the same collider before it automatically attempts to select it. 0f means no selection attempt will be made.
  858. * **Interact With Objects:** If this is checked then the pointer will be an extension of the controller and able to interact with Interactable Objects.
  859. * **Grab To Pointer Tip:** If `Interact With Objects` is checked and this is checked then when an object is grabbed with the pointer touching it, the object will attach to the pointer tip and not snap to the controller.
  860. * **Attached To:** An optional GameObject that determines what the pointer is to be attached to. If this is left blank then the GameObject the script is on will be used.
  861. * **Controller Events:** An optional Controller Events that will be used to toggle the pointer. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  862. * **Interact Use:** An optional InteractUse script that will be used when using interactable objects with pointer. If this is left blank then it will attempt to get the InteractUse script from the same GameObject and if it cannot find one then it will attempt to get it from the attached controller.
  863. * **Custom Origin:** A custom transform to use as the origin of the pointer. If no pointer origin transform is provided then the transform the script is attached to is used.
  864. ### Class Events
  865. * `ActivationButtonPressed` - Emitted when the pointer activation button is pressed.
  866. * `ActivationButtonReleased` - Emitted when the pointer activation button is released.
  867. * `SelectionButtonPressed` - Emitted when the pointer selection button is pressed.
  868. * `SelectionButtonReleased` - Emitted when the pointer selection button is released.
  869. * `PointerStateValid` - Emitted when the pointer is in a valid state.
  870. * `PointerStateInvalid` - Emitted when the pointer is in an invalid state.
  871. ### Unity Events
  872. Adding the `VRTK_Pointer_UnityEvents` component to `VRTK_Pointer` object allows access to `UnityEvents` that will react identically to the Class Events.
  873. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  874. ### Class Methods
  875. #### IsActivationButtonPressed/0
  876. > `public virtual bool IsActivationButtonPressed()`
  877. * Parameters
  878. * _none_
  879. * Returns
  880. * `bool` - Returns `true` if the activationButton is being pressed.
  881. The IsActivationButtonPressed method returns whether the configured activation button is being pressed.
  882. #### IsSelectionButtonPressed/0
  883. > `public virtual bool IsSelectionButtonPressed()`
  884. * Parameters
  885. * _none_
  886. * Returns
  887. * `bool` - Returns `true` if the selectionButton is being pressed.
  888. The IsSelectionButtonPressed method returns whether the configured activation button is being pressed.
  889. #### PointerEnter/1
  890. > `public virtual void PointerEnter(RaycastHit givenHit)`
  891. * Parameters
  892. * `RaycastHit givenHit` - The valid collision.
  893. * Returns
  894. * _none_
  895. The PointerEnter method emits a DestinationMarkerEnter event when the pointer first enters a valid object, it emits a DestinationMarkerHover for every following frame that the pointer stays over the valid object.
  896. #### PointerExit/1
  897. > `public virtual void PointerExit(RaycastHit givenHit)`
  898. * Parameters
  899. * `RaycastHit givenHit` - The previous valid collision.
  900. * Returns
  901. * _none_
  902. The PointerExit method emits a DestinationMarkerExit event when the pointer leaves a previously entered object.
  903. #### CanActivate/0
  904. > `public virtual bool CanActivate()`
  905. * Parameters
  906. * _none_
  907. * Returns
  908. * `bool` - Returns `true` if the pointer can be activated.
  909. The CanActivate method is used to determine if the pointer has passed the activation time limit.
  910. #### CanSelect/0
  911. > `public virtual bool CanSelect()`
  912. * Parameters
  913. * _none_
  914. * Returns
  915. * `bool` - Returns `true` if the pointer can execute the select action.
  916. The CanSelect method is used to determine if the pointer has passed the selection time limit.
  917. #### IsPointerActive/0
  918. > `public virtual bool IsPointerActive()`
  919. * Parameters
  920. * _none_
  921. * Returns
  922. * `bool` - Returns `true` if the pointer is currently active.
  923. The IsPointerActive method is used to determine if the pointer's current state is active or not.
  924. #### ResetActivationTimer/1
  925. > `public virtual void ResetActivationTimer(bool forceZero = false)`
  926. * Parameters
  927. * `bool forceZero` - If this is `true` then the next activation time will be 0.
  928. * Returns
  929. * _none_
  930. The ResetActivationTimer method is used to reset the pointer activation timer to the next valid activation time.
  931. #### ResetSelectionTimer/1
  932. > `public virtual void ResetSelectionTimer(bool forceZero = false)`
  933. * Parameters
  934. * `bool forceZero` - If this is `true` then the next activation time will be 0.
  935. * Returns
  936. * _none_
  937. The ResetSelectionTimer method is used to reset the pointer selection timer to the next valid activation time.
  938. #### Toggle/1
  939. > `public virtual void Toggle(bool state)`
  940. * Parameters
  941. * `bool state` - If `true` the pointer will be enabled if possible, if `false` the pointer will be disabled if possible.
  942. * Returns
  943. * _none_
  944. The Toggle method is used to enable or disable the pointer.
  945. #### IsStateValid/0
  946. > `public virtual bool IsStateValid()`
  947. * Parameters
  948. * _none_
  949. * Returns
  950. * `bool` - Returns `true` if the pointer is in the valid state (showing the valid colour), returns `false` if the pointer is in the invalid state (showing the invalid colour).
  951. The IsStateValid method is used to determine if the pointer is currently in a valid state (i.e. on it's valid colour).
  952. ---
  953. ## Play Area Cursor (VRTK_PlayAreaCursor)
  954. ### Overview
  955. Provides a visual representation of the play area boundaries that tracks to the cursor position of a pointer.
  956. **Optional Components:**
  957. * `VRTK_PointerDirectionIndicator` - A Pointer Direction Indicator to set the cursor rotation to.
  958. **Script Usage:**
  959. * Place the `VRTK_PlayAreaCursor` script on the same GameObject as the Pointer Renderer script it is linked to.
  960. * Link the required Play Area Cursor script to the `Playarea Cursor` parameter on the required Pointer Renderer script.
  961. **Script Dependencies:**
  962. * A Base Pointer Renderer script attached to a valid Pointer script is required so the PlayArea Cursor script can be linked to follow the valid Base Pointer Renderer cursor GameObject.
  963. ### Inspector Parameters
  964. * **Use Pointer Color:** If this is checked then the pointer valid/invalid colours will also be used to change the colour of the play area cursor when colliding/not colliding.
  965. * **Play Area Cursor Dimensions:** Determines the size of the play area cursor and collider. If the values are left as zero then the Play Area Cursor will be sized to the calibrated Play Area space.
  966. * **Handle Play Area Cursor Collisions:** If this is checked then if the play area cursor is colliding with any other object then the pointer colour will change to the `Pointer Miss Color` and the `DestinationMarkerSet` event will not be triggered, which will prevent teleporting into areas where the play area will collide.
  967. * **Headset Out Of Bounds Is Collision:** If this is checked then if the user's headset is outside of the play area cursor bounds then it is considered a collision even if the play area isn't colliding with anything.
  968. * **Display On Invalid Location:** If this is checked then the play area cursor will be displayed when the location is invalid.
  969. * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether the play area cursor collisions will be acted upon.
  970. * **Direction Indicator:** A custom Pointer Direction Indicator to use to determine the rotation of the Play Area Cursor.
  971. * **Valid Location Object:** A custom GameObject to use for the play area cursor representation for when the location is valid.
  972. * **Invalid Location Object:** A custom GameObject to use for the play area cursor representation for when the location is invalid.
  973. ### Class Events
  974. * `PlayAreaCursorStartCollision` - Emitted when the play area collides with another object.
  975. * `PlayAreaCursorEndCollision` - Emitted when the play area stops colliding with another object.
  976. ### Unity Events
  977. Adding the `VRTK_PlayAreaCursor_UnityEvents` component to `VRTK_PlayAreaCursor` object allows access to `UnityEvents` that will react identically to the Class Events.
  978. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  979. ### Event Payload
  980. * ` collidedWith` - The collider that is/was being collided with.
  981. ### Class Methods
  982. #### HasCollided/0
  983. > `public virtual bool HasCollided()`
  984. * Parameters
  985. * _none_
  986. * Returns
  987. * `bool` - Returns `true` if the play area is colliding with a valid object and `false` if not.
  988. The HasCollided method returns the state of whether the play area cursor has currently collided with another valid object.
  989. #### SetHeadsetPositionCompensation/1
  990. > `public virtual void SetHeadsetPositionCompensation(bool state)`
  991. * Parameters
  992. * `bool state` - The state of whether to take the position of the headset within the play area into account when setting the destination marker.
  993. * Returns
  994. * _none_
  995. The SetHeadsetPositionCompensation method determines whether the offset position of the headset from the centre of the play area should be taken into consideration when setting the destination marker. If `true` then it will take the offset position into consideration.
  996. #### SetPlayAreaCursorCollision/2
  997. > `public virtual void SetPlayAreaCursorCollision(bool state, Collider collider = null)`
  998. * Parameters
  999. * `bool state` - The state of whether to check for play area collisions.
  1000. * `Collider collider` - The state of whether to check for play area collisions.
  1001. * Returns
  1002. * _none_
  1003. The SetPlayAreaCursorCollision method determines whether play area collisions should be taken into consideration with the play area cursor.
  1004. #### SetMaterialColor/2
  1005. > `public virtual void SetMaterialColor(Color color, bool validity)`
  1006. * Parameters
  1007. * `Color color` - The colour to update the play area cursor material to.
  1008. * `bool validity` - Determines if the colour being set is based from a valid location or invalid location.
  1009. * Returns
  1010. * _none_
  1011. The SetMaterialColor method sets the current material colour on the play area cursor.
  1012. #### SetPlayAreaCursorTransform/1
  1013. > `public virtual void SetPlayAreaCursorTransform(Vector3 location)`
  1014. * Parameters
  1015. * `Vector3 location` - The location where to draw the play area cursor.
  1016. * Returns
  1017. * _none_
  1018. The SetPlayAreaCursorTransform method is used to update the position of the play area cursor in world space to the given location.
  1019. #### ToggleState/1
  1020. > `public virtual void ToggleState(bool state)`
  1021. * Parameters
  1022. * `bool state` - The state of whether to show or hide the play area cursor.
  1023. * Returns
  1024. * _none_
  1025. The ToggleState method enables or disables the visibility of the play area cursor.
  1026. #### IsActive/0
  1027. > `public virtual bool IsActive()`
  1028. * Parameters
  1029. * _none_
  1030. * Returns
  1031. * `bool` - Returns `true` if the play area cursor GameObject is active.
  1032. The IsActive method returns whether the play area cursor GameObject is active or not.
  1033. #### GetPlayAreaContainer/0
  1034. > `public virtual GameObject GetPlayAreaContainer()`
  1035. * Parameters
  1036. * _none_
  1037. * Returns
  1038. * `GameObject` - The GameObject that is the container of the play area cursor.
  1039. The GetPlayAreaContainer method returns the created GameObject that holds the play area cursor representation.
  1040. #### ToggleVisibility/1
  1041. > `public virtual void ToggleVisibility(bool state)`
  1042. * Parameters
  1043. * `bool state` - The state of the cursor visibility. True will show the renderers and false will hide the renderers.
  1044. * Returns
  1045. * _none_
  1046. The ToggleVisibility method enables or disables the play area cursor renderers to allow the cursor to be seen or hidden.
  1047. ### Example
  1048. `VRTK/Examples/012_Controller_PointerWithAreaCollision` shows how a Bezier Pointer with the Play Area Cursor and Collision Detection enabled can be used to traverse a game area but not allow teleporting into areas where the walls or other objects would fall into the play area space enabling the user to enter walls.
  1049. ---
  1050. # Pointer Renderers (VRTK/Source/Scripts/Pointers/PointerRenderers)
  1051. A collection of scripts that are used to provide different renderers for the VRTK_Pointer.
  1052. * [Base Pointer Renderer](#base-pointer-renderer-vrtk_basepointerrenderer)
  1053. * [Straight Pointer Renderer](#straight-pointer-renderer-vrtk_straightpointerrenderer)
  1054. * [Bezier Pointer Renderer](#bezier-pointer-renderer-vrtk_bezierpointerrenderer)
  1055. ---
  1056. ## Base Pointer Renderer (VRTK_BasePointerRenderer)
  1057. ### Overview
  1058. Provides a base that all pointer renderers can inherit from.
  1059. **Script Usage:**
  1060. > This is an abstract class that is to be inherited to a concrete class that provides pointer renderer functionality, therefore this script should not be directly used.
  1061. ### Inspector Parameters
  1062. * **Smooths Position:** Whether or not to smooth the position of the pointer origin when positioning the pointer tip.
  1063. * **Max Allowed Per Frame Distance Difference:** The maximum allowed distance between the unsmoothed pointer origin and the smoothed pointer origin per frame to use for smoothing.
  1064. * **Smooths Rotation:** Whether or not to smooth the rotation of the pointer origin when positioning the pointer tip.
  1065. * **Max Allowed Per Frame Angle Difference:** The maximum allowed angle between the unsmoothed pointer origin and the smoothed pointer origin per frame to use for smoothing.
  1066. * **Playarea Cursor:** An optional Play Area Cursor generator to add to the destination position of the pointer tip.
  1067. * **Direction Indicator:** A custom VRTK_PointerDirectionIndicator to use to determine the rotation given to the destination set event.
  1068. * **Custom Raycast:** A custom raycaster to use for the pointer's raycasts to ignore.
  1069. * **Pointer Origin Smoothing Settings:** Specifies the smoothing to be applied to the pointer origin when positioning the pointer tip.
  1070. * **Valid Collision Color:** The colour to change the pointer materials when the pointer collides with a valid object. Set to `Color.clear` to bypass changing material colour on valid collision.
  1071. * **Invalid Collision Color:** The colour to change the pointer materials when the pointer is not colliding with anything or with an invalid object. Set to `Color.clear` to bypass changing material colour on invalid collision.
  1072. * **Tracer Visibility:** Determines when the main tracer of the pointer renderer will be visible.
  1073. * **Cursor Visibility:** Determines when the cursor/tip of the pointer renderer will be visible.
  1074. ### Class Variables
  1075. * `public enum VisibilityStates` - States of Pointer Visibility.
  1076. * `OnWhenActive` - Only shows the object when the pointer is active.
  1077. * `AlwaysOn` - Ensures the object is always.
  1078. * `AlwaysOff` - Ensures the object beam is never visible.
  1079. ### Class Methods
  1080. #### GetPointerObjects/0
  1081. > `public abstract GameObject[] GetPointerObjects();`
  1082. * Parameters
  1083. * _none_
  1084. * Returns
  1085. * `GameObject[]` - An array of pointer auto generated GameObjects.
  1086. The GetPointerObjects returns an array of the auto generated GameObjects associated with the pointer.
  1087. #### InitalizePointer/4
  1088. > `public virtual void InitalizePointer(VRTK_Pointer givenPointer, VRTK_PolicyList givenInvalidListPolicy, VRTK_NavMeshData givenNavMeshData, bool givenHeadsetPositionCompensation)`
  1089. * Parameters
  1090. * `VRTK_Pointer givenPointer` - The VRTK_Pointer that is controlling the pointer renderer.
  1091. * `VRTK_PolicyList givenInvalidListPolicy` - The VRTK_PolicyList for managing valid and invalid pointer locations.
  1092. * `VRTK_NavMeshData givenNavMeshData` - The NavMeshData object that contains the Nav Mesh restriction options.
  1093. * `bool givenHeadsetPositionCompensation` - Determines whether the play area cursor will take the headset position within the play area into account when being displayed.
  1094. * Returns
  1095. * _none_
  1096. The InitalizePointer method is used to set up the state of the pointer renderer.
  1097. #### ResetPointerObjects/0
  1098. > `public virtual void ResetPointerObjects()`
  1099. * Parameters
  1100. * _none_
  1101. * Returns
  1102. * _none_
  1103. The ResetPointerObjects method is used to destroy any existing pointer objects and recreate them at runtime.
  1104. #### Toggle/2
  1105. > `public virtual void Toggle(bool pointerState, bool actualState)`
  1106. * Parameters
  1107. * `bool pointerState` - The activation state of the pointer.
  1108. * `bool actualState` - The actual state of the activation button press.
  1109. * Returns
  1110. * _none_
  1111. The Toggle Method is used to enable or disable the pointer renderer.
  1112. #### ToggleInteraction/1
  1113. > `public virtual void ToggleInteraction(bool state)`
  1114. * Parameters
  1115. * `bool state` - If true then the object interactor will be enabled.
  1116. * Returns
  1117. * _none_
  1118. The ToggleInteraction method is used to enable or disable the controller extension interactions.
  1119. #### UpdateRenderer/0
  1120. > `public virtual void UpdateRenderer()`
  1121. * Parameters
  1122. * _none_
  1123. * Returns
  1124. * _none_
  1125. The UpdateRenderer method is used to run an Update routine on the pointer.
  1126. #### GetDestinationHit/0
  1127. > `public virtual RaycastHit GetDestinationHit()`
  1128. * Parameters
  1129. * _none_
  1130. * Returns
  1131. * `RaycastHit` - The RaycastHit containing the information where the pointer is hitting.
  1132. The GetDestinationHit method is used to get the RaycastHit of the pointer destination.
  1133. #### ValidPlayArea/0
  1134. > `public virtual bool ValidPlayArea()`
  1135. * Parameters
  1136. * _none_
  1137. * Returns
  1138. * `bool` - Returns true if there is a valid play area and no collisions. Returns false if there is no valid play area or there is but with a collision detected.
  1139. The ValidPlayArea method is used to determine if there is a valid play area and if it has had any collisions.
  1140. #### IsVisible/0
  1141. > `public virtual bool IsVisible()`
  1142. * Parameters
  1143. * _none_
  1144. * Returns
  1145. * `bool` - Returns true if either the tracer or cursor renderers are visible. Returns false if none are visible.
  1146. The IsVisible method determines if the pointer renderer is at all visible by checking the state of the tracer and the cursor.
  1147. #### IsTracerVisible/0
  1148. > `public virtual bool IsTracerVisible()`
  1149. * Parameters
  1150. * _none_
  1151. * Returns
  1152. * `bool` - Returns true if the tracer renderers are visible.
  1153. The IsTracerVisible method determines if the pointer tracer renderer is visible.
  1154. #### IsCursorVisible/0
  1155. > `public virtual bool IsCursorVisible()`
  1156. * Parameters
  1157. * _none_
  1158. * Returns
  1159. * `bool` - Returns true if the cursor renderers are visible.
  1160. The IsCursorVisible method determines if the pointer cursor renderer is visible.
  1161. #### IsValidCollision/0
  1162. > `public virtual bool IsValidCollision()`
  1163. * Parameters
  1164. * _none_
  1165. * Returns
  1166. * `bool` - Returns true if the pointer is in a valid collision, returns false if the pointer is in an invalid collision state.
  1167. The IsValidCollision method determines if the pointer is currently in it's valid collision state.
  1168. #### GetObjectInteractor/0
  1169. > `public virtual GameObject GetObjectInteractor()`
  1170. * Parameters
  1171. * _none_
  1172. * Returns
  1173. * `GameObject` - The auto generated object interactor GameObject.
  1174. * `GameObject` -
  1175. The GetObjectInteractor method returns the auto generated GameObject that acts as the controller extension for interacting with objects.
  1176. ---
  1177. ## Straight Pointer Renderer (VRTK_StraightPointerRenderer)
  1178. > extends [VRTK_BasePointerRenderer](#base-pointer-renderer-vrtk_basepointerrenderer)
  1179. ### Overview
  1180. A visual pointer representation of a straight beam with an optional cursor at the end.
  1181. **Optional Components:**
  1182. * `VRTK_PlayAreaCursor` - A Play Area Cursor that will track the position of the pointer cursor.
  1183. * `VRTK_PointerDirectionIndicator` - A Pointer Direction Indicator that will track the position of the pointer cursor.
  1184. **Script Usage:**
  1185. * Place the `VRTK_StraightPointerRenderer` script on the same GameObject as the Pointer script it is linked to.
  1186. * Link this Pointer Renderer script to the `Pointer Renderer` parameter on the required Pointer script.
  1187. **Script Dependencies:**
  1188. * A Pointer script to control the activation of this Pointer Renderer script.
  1189. ### Inspector Parameters
  1190. * **Maximum Length:** The maximum length the pointer tracer can reach.
  1191. * **Scale Factor:** The scale factor to scale the pointer tracer object by.
  1192. * **Cursor Scale Multiplier:** The scale multiplier to scale the pointer cursor object by in relation to the `Scale Factor`.
  1193. * **Cursor Match Target Rotation:** The cursor will be rotated to match the angle of the target surface if this is true, if it is false then the pointer cursor will always be horizontal.
  1194. * **Cursor Distance Rescale:** Rescale the cursor proportionally to the distance from the tracer origin.
  1195. * **Maximum Cursor Scale:** The maximum scale the cursor is allowed to reach. This is only used when rescaling the cursor proportionally to the distance from the tracer origin.
  1196. * **Custom Tracer:** A custom game object to use as the appearance for the pointer tracer. If this is empty then a Box primitive will be created and used.
  1197. * **Custom Cursor:** A custom game object to use as the appearance for the pointer cursor. If this is empty then a Sphere primitive will be created and used.
  1198. ### Class Methods
  1199. #### UpdateRenderer/0
  1200. > `public override void UpdateRenderer()`
  1201. * Parameters
  1202. * _none_
  1203. * Returns
  1204. * _none_
  1205. The UpdateRenderer method is used to run an Update routine on the pointer.
  1206. #### GetPointerObjects/0
  1207. > `public override GameObject[] GetPointerObjects()`
  1208. * Parameters
  1209. * _none_
  1210. * Returns
  1211. * `GameObject[]` - An array of pointer auto generated GameObjects.
  1212. The GetPointerObjects returns an array of the auto generated GameObjects associated with the pointer.
  1213. ### Example
  1214. `VRTK/Examples/003_Controller_SimplePointer` shows the simple pointer in action and code examples of how the events are utilised and listened to can be viewed in the script `VRTK/Examples/ExampleResources/Scripts/VRTK_ControllerPointerEvents_ListenerExample.cs`
  1215. ---
  1216. ## Bezier Pointer Renderer (VRTK_BezierPointerRenderer)
  1217. > extends [VRTK_BasePointerRenderer](#base-pointer-renderer-vrtk_basepointerrenderer)
  1218. ### Overview
  1219. A visual pointer representation of a curved beam made from multiple objects with an optional cursor at the end.
  1220. > The bezier curve generation code is in another script located at `VRTK/Source/Scripts/Internal/VRTK_CurveGenerator.cs` and was heavily inspired by the tutorial and code from [Catlike Coding](http://catlikecoding.com/unity/tutorials/curves-and-splines/).
  1221. **Optional Components:**
  1222. * `VRTK_PlayAreaCursor` - A Play Area Cursor that will track the position of the pointer cursor.
  1223. * `VRTK_PointerDirectionIndicator` - A Pointer Direction Indicator that will track the position of the pointer cursor.
  1224. **Script Usage:**
  1225. * Place the `VRTK_BezierPointerRenderer` script on the same GameObject as the Pointer script it is linked to.
  1226. * Link this Pointer Renderer script to the `Pointer Renderer` parameter on the required Pointer script.
  1227. **Script Dependencies:**
  1228. * A Pointer script to control the activation of this Pointer Renderer script.
  1229. ### Inspector Parameters
  1230. * **Maximum Length:** The maximum length of the projected beam. The x value is the length of the forward beam, the y value is the length of the downward beam.
  1231. * **Tracer Density:** The number of items to render in the bezier curve tracer beam. A high number here will most likely have a negative impact of game performance due to large number of rendered objects.
  1232. * **Cursor Radius:** The size of the ground cursor. This number also affects the size of the objects in the bezier curve tracer beam. The larger the radius, the larger the objects will be.
  1233. * **Height Limit Angle:** The maximum angle in degrees of the origin before the beam curve height is restricted. A lower angle setting will prevent the beam being projected high into the sky and curving back down.
  1234. * **Curve Offset:** The amount of height offset to apply to the projected beam to generate a smoother curve even when the beam is pointing straight.
  1235. * **Rescale Tracer:** Rescale each tracer element according to the length of the Bezier curve.
  1236. * **Cursor Match Target Rotation:** The cursor will be rotated to match the angle of the target surface if this is true, if it is false then the pointer cursor will always be horizontal.
  1237. * **Collision Check Frequency:** The number of points along the bezier curve to check for an early beam collision. Useful if the bezier curve is appearing to clip through teleport locations. 0 won't make any checks and it will be capped at `Pointer Density`. The higher the number, the more CPU intensive the checks become.
  1238. * **Custom Tracer:** A custom game object to use as the appearance for the pointer tracer. If this is empty then a collection of Sphere primitives will be created and used.
  1239. * **Custom Cursor:** A custom game object to use as the appearance for the pointer cursor. If this is empty then a Cylinder primitive will be created and used.
  1240. * **Valid Location Object:** A custom game object can be applied here to appear only if the location is valid.
  1241. * **Invalid Location Object:** A custom game object can be applied here to appear only if the location is invalid.
  1242. ### Class Methods
  1243. #### UpdateRenderer/0
  1244. > `public override void UpdateRenderer()`
  1245. * Parameters
  1246. * _none_
  1247. * Returns
  1248. * _none_
  1249. The UpdateRenderer method is used to run an Update routine on the pointer.
  1250. #### GetPointerObjects/0
  1251. > `public override GameObject[] GetPointerObjects()`
  1252. * Parameters
  1253. * _none_
  1254. * Returns
  1255. * `GameObject[]` - An array of pointer auto generated GameObjects.
  1256. The GetPointerObjects returns an array of the auto generated GameObjects associated with the pointer.
  1257. ### Example
  1258. `VRTK/Examples/009_Controller_BezierPointer` is used in conjunction with the Height Adjust Teleporter shows how it is possible to traverse different height objects using the curved pointer without needing to see the top of the object.
  1259. `VRTK/Examples/036_Controller_CustomCompoundPointer' shows how to display an object (a teleport beam) only if the teleport location is valid, and can create an animated trail along the tracer curve.
  1260. ---
  1261. # Locomotion (VRTK/Source/Scripts/Locomotion)
  1262. A collection of scripts that provide varying methods of moving the user around the scene.
  1263. * [Basic Teleport](#basic-teleport-vrtk_basicteleport)
  1264. * [Height Adjust Teleport](#height-adjust-teleport-vrtk_heightadjustteleport)
  1265. * [Dash Teleport](#dash-teleport-vrtk_dashteleport)
  1266. * [Teleport Disable On Headset Collision](#teleport-disable-on-headset-collision-vrtk_teleportdisableonheadsetcollision)
  1267. * [Teleport Disable On Controller Obscured](#teleport-disable-on-controller-obscured-vrtk_teleportdisableoncontrollerobscured)
  1268. * [Object Control](#object-control-vrtk_objectcontrol)
  1269. * [Touchpad Control](#touchpad-control-vrtk_touchpadcontrol)
  1270. * [Button Control](#button-control-vrtk_buttoncontrol)
  1271. * [Move In Place](#move-in-place-vrtk_moveinplace)
  1272. * [Player Climb](#player-climb-vrtk_playerclimb)
  1273. * [Slingshot Jump](#slingshot-jump-vrtk_slingshotjump)
  1274. * [Step Multiplier](#step-multiplier-vrtk_stepmultiplier)
  1275. * [Tunnel Overlay](#tunnel-overlay-vrtk_tunneloverlay)
  1276. * [Drag World](#drag-world-vrtk_dragworld)
  1277. ---
  1278. ## Basic Teleport (VRTK_BasicTeleport)
  1279. ### Overview
  1280. Updates the `x/z` position of the SDK Camera Rig with an optional screen fade.
  1281. > The `y` position is not altered by the Basic Teleport so it only allows for movement across a 2D plane.
  1282. **Script Usage:**
  1283. * Place the `VRTK_BasicTeleport` script on any active scene GameObject.
  1284. **Script Dependencies:**
  1285. * An optional Destination Marker (such as a Pointer) to set the destination of the teleport location.
  1286. ### Inspector Parameters
  1287. * **Blink To Color:** The colour to fade to when fading on teleport.
  1288. * **Blink Transition Speed:** The time taken to fade to the `Blink To Color`. Setting the speed to `0` will mean no fade effect is present.
  1289. * **Distance Blink Delay:** Determines how long the fade will stay present out depending on the distance being teleported. A value of `0` will not delay the teleport fade effect over any distance, a max value will delay the teleport fade in even when the distance teleported is very close to the original position.
  1290. * **Headset Position Compensation:** If this is checked then the teleported location will be the position of the headset within the play area. If it is unchecked then the teleported location will always be the centre of the play area even if the headset position is not in the centre of the play area.
  1291. * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether destination targets will be acted upon by the teleporter.
  1292. * **Nav Mesh Data:** An optional NavMeshData object that will be utilised for limiting the teleport to within any scene NavMesh.
  1293. ### Class Events
  1294. * `Teleporting` - Emitted when the teleport process has begun.
  1295. * `Teleported` - Emitted when the teleport process has successfully completed.
  1296. ### Unity Events
  1297. Adding the `VRTK_BasicTeleport_UnityEvents` component to `VRTK_BasicTeleport` object allows access to `UnityEvents` that will react identically to the Class Events.
  1298. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  1299. ### Event Payload
  1300. * `float distance` - The distance between the origin and the collided destination.
  1301. * `Transform target` - The Transform of the collided destination object.
  1302. * `RaycastHit raycastHit` - The optional RaycastHit generated from when the ray collided.
  1303. * `Vector3 destinationPosition` - The world position of the destination marker.
  1304. * `Quaternion? destinationRotation` - The world rotation of the destination marker.
  1305. * `bool forceDestinationPosition` - If true then the given destination position should not be altered by anything consuming the payload.
  1306. * `bool enableTeleport` - Whether the destination set event should trigger teleport.
  1307. * `VRTK_ControllerReference controllerReference` - The optional reference to the controller controlling the destination marker.
  1308. ### Class Methods
  1309. #### InitDestinationSetListener/2
  1310. > `public virtual void InitDestinationSetListener(GameObject markerMaker, bool register)`
  1311. * Parameters
  1312. * `GameObject markerMaker` - The game object that is used to generate destination marker events, such as a controller.
  1313. * `bool register` - Determines whether to register or unregister the listeners.
  1314. * Returns
  1315. * _none_
  1316. The InitDestinationSetListener method is used to register the teleport script to listen to events from the given game object that is used to generate destination markers. Any destination set event emitted by a registered game object will initiate the teleport to the given destination location.
  1317. #### ToggleTeleportEnabled/1
  1318. > `public virtual void ToggleTeleportEnabled(bool state)`
  1319. * Parameters
  1320. * `bool state` - Toggles whether the teleporter is enabled or disabled.
  1321. * Returns
  1322. * _none_
  1323. The ToggleTeleportEnabled method is used to determine whether the teleporter will initiate a teleport on a destination set event, if the state is true then the teleporter will work as normal, if the state is false then the teleporter will not be operational.
  1324. #### ValidLocation/2
  1325. > `public virtual bool ValidLocation(Transform target, Vector3 destinationPosition)`
  1326. * Parameters
  1327. * `Transform target` - The Transform that the destination marker is touching.
  1328. * `Vector3 destinationPosition` - The position in world space that is the destination.
  1329. * Returns
  1330. * `bool` - Returns `true` if the target is a valid location.
  1331. The ValidLocation method determines if the given target is a location that can be teleported to
  1332. #### Teleport/1
  1333. > `public virtual void Teleport(DestinationMarkerEventArgs teleportArgs)`
  1334. * Parameters
  1335. * `DestinationMarkerEventArgs teleportArgs` - The pseudo Destination Marker event for the teleport action.
  1336. * Returns
  1337. * _none_
  1338. The Teleport/1 method calls the teleport to update position without needing to listen for a Destination Marker event.
  1339. #### Teleport/4
  1340. > `public virtual void Teleport(Transform target, Vector3 destinationPosition, Quaternion? destinationRotation = null, bool forceDestinationPosition = false)`
  1341. * Parameters
  1342. * `Transform target` - The Transform of the destination object.
  1343. * `Vector3 destinationPosition` - The world position to teleport to.
  1344. * `Quaternion? destinationRotation` - The world rotation to teleport to.
  1345. * `bool forceDestinationPosition` - If `true` then the given destination position should not be altered by anything consuming the payload.
  1346. * Returns
  1347. * _none_
  1348. The Teleport/4 method calls the teleport to update position without needing to listen for a Destination Marker event. It will build a destination marker out of the provided parameters.
  1349. #### ForceTeleport/2
  1350. > `public virtual void ForceTeleport(Vector3 destinationPosition, Quaternion? destinationRotation = null)`
  1351. * Parameters
  1352. * `Vector3 destinationPosition` - The world position to teleport to.
  1353. * `Quaternion? destinationRotation` - The world rotation to teleport to.
  1354. * Returns
  1355. * _none_
  1356. The ForceTeleport method forces the position to update to a given destination and ignores any target checking or floor adjustment.
  1357. #### SetActualTeleportDestination/2
  1358. > `public virtual void SetActualTeleportDestination(Vector3 actualPosition, Quaternion? actualRotation)`
  1359. * Parameters
  1360. * `Vector3 actualPosition` - The actual position that the teleport event should use as the final location.
  1361. * `Quaternion? actualRotation` - The actual rotation that the teleport event should use as the final location.
  1362. * Returns
  1363. * _none_
  1364. The SetActualTeleportDestination method forces the destination of a teleport event to the given Vector3.
  1365. #### ResetActualTeleportDestination/0
  1366. > `public virtual void ResetActualTeleportDestination()`
  1367. * Parameters
  1368. * _none_
  1369. * Returns
  1370. * _none_
  1371. The ResetActualTeleportDestination method removes any previous forced destination position that was set by the SetActualTeleportDestination method.
  1372. ### Example
  1373. `VRTK/Examples/004_CameraRig_BasicTeleport` uses the `VRTK_Pointer` script on the Controllers to initiate a laser pointer by pressing the `Touchpad` on the controller and when the laser pointer is deactivated (release the `Touchpad`) then the user is teleported to the location of the laser pointer tip as this is where the pointer destination marker position is set to.
  1374. ---
  1375. ## Height Adjust Teleport (VRTK_HeightAdjustTeleport)
  1376. > extends [VRTK_BasicTeleport](#basic-teleport-vrtk_basicteleport)
  1377. ### Overview
  1378. Updates the `x/y/z` position of the SDK Camera Rig with an optional screen fade.
  1379. > The Camera Rig can be automatically teleported to the nearest floor `y` position when utilising this teleporter.
  1380. **Script Usage:**
  1381. * Place the `VRTK_HeightAdjustTeleport` script on any active scene GameObject.
  1382. **Script Dependencies:**
  1383. * An optional Destination Marker (such as a Pointer) to set the destination of the teleport location.
  1384. ### Inspector Parameters
  1385. * **Snap To Nearest Floor:** If this is checked, then the teleported Y position will snap to the nearest available below floor. If it is unchecked, then the teleported Y position will be where ever the destination Y position is.
  1386. * **Apply Playarea Parent Offset:** If this is checked then the teleported Y position will also be offset by the play area parent Transform Y position (if the play area has a parent).
  1387. * **Custom Raycast:** A custom raycaster to use when raycasting to find floors.
  1388. ### Example
  1389. `VRTK/Examples/007_CameraRig_HeightAdjustTeleport` has a collection of varying height objects that the user can either walk up and down or use the laser pointer to climb on top of them.
  1390. `VRTK/Examples/010_CameraRig_TerrainTeleporting` shows how the teleportation of a user can also traverse terrain colliders.
  1391. `VRTK/Examples/020_CameraRig_MeshTeleporting` shows how the teleportation of a user can also traverse mesh colliders.
  1392. ---
  1393. ## Dash Teleport (VRTK_DashTeleport)
  1394. > extends [VRTK_HeightAdjustTeleport](#height-adjust-teleport-vrtk_heightadjustteleport)
  1395. ### Overview
  1396. Updates the `x/y/z` position of the SDK Camera Rig with a lerp to the new position creating a dash effect.
  1397. **Script Usage:**
  1398. * Place the `VRTK_DashTeleport` script on any active scene GameObject.
  1399. **Script Dependencies:**
  1400. * An optional Destination Marker (such as a Pointer) to set the destination of the teleport location.
  1401. ### Inspector Parameters
  1402. * **Normal Lerp Time:** The fixed time it takes to dash to a new position.
  1403. * **Min Speed Mps:** The minimum speed for dashing in meters per second.
  1404. * **Capsule Top Offset:** The Offset of the CapsuleCast above the camera.
  1405. * **Capsule Bottom Offset:** The Offset of the CapsuleCast below the camera.
  1406. * **Capsule Radius:** The radius of the CapsuleCast.
  1407. ### Class Events
  1408. * `WillDashThruObjects` - Emitted when the CapsuleCast towards the target has found that obstacles are in the way.
  1409. * `DashedThruObjects` - Emitted when obstacles have been crossed and the dash has ended.
  1410. ### Unity Events
  1411. Adding the `VRTK_DashTeleport_UnityEvents` component to `VRTK_DashTeleport` object allows access to `UnityEvents` that will react identically to the Class Events.
  1412. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  1413. ### Event Payload
  1414. * `RaycastHit[] hits` - An array of RaycastHits that the CapsuleCast has collided with.
  1415. ### Example
  1416. `VRTK/Examples/038_CameraRig_DashTeleport` shows how to turn off the mesh renderers of objects that are in the way during the dash.
  1417. ---
  1418. ## Teleport Disable On Headset Collision (VRTK_TeleportDisableOnHeadsetCollision)
  1419. ### Overview
  1420. Prevents teleportation when the HMD is colliding with valid geometry.
  1421. **Required Components:**
  1422. * `VRTK_BasicTeleport` - A Teleport script to utilise for teleporting the play area.
  1423. * `VRTK_HeadsetCollision` - A Headset Collision script for detecting when the headset has collided with valid geometry.
  1424. **Script Usage:**
  1425. * Place the `VRTK_TeleportDisableOnHeadsetCollision` script on any active scene GameObject.
  1426. ### Inspector Parameters
  1427. * **Teleporter:** The Teleporter script to deal play area teleporting. If the script is being applied onto an object that already has a VRTK_BasicTeleport component, this parameter can be left blank as it will be auto populated by the script at runtime.
  1428. * **Headset Collision:** The VRTK Headset Collision script to use when determining headset collisions. If this is left blank then the script will need to be applied to the same GameObject.
  1429. ---
  1430. ## Teleport Disable On Controller Obscured (VRTK_TeleportDisableOnControllerObscured)
  1431. ### Overview
  1432. Prevents teleportation when the controllers are obscured from line of sight of the HMD.
  1433. **Required Components:**
  1434. * `VRTK_BasicTeleport` - A Teleport script to utilise for teleporting the play area.
  1435. * `VRTK_HeadsetControllerAware` - A Headset Controller Aware script to determine when the HMD has line of sight to the controllers.
  1436. **Script Usage:**
  1437. * Place the `VRTK_TeleportDisableOnControllerObscured` script on any active scene GameObject.
  1438. ### Inspector Parameters
  1439. * **Teleporter:** The Teleporter script to deal play area teleporting. If the script is being applied onto an object that already has a VRTK_BasicTeleport component, this parameter can be left blank as it will be auto populated by the script at runtime.
  1440. * **Headset Controller Aware:** The VRTK Headset Controller Aware script to use when dealing with the headset to controller awareness. If this is left blank then the script will need to be applied to the same GameObject.
  1441. ---
  1442. ## Object Control (VRTK_ObjectControl)
  1443. ### Overview
  1444. Provides a base that all object control locomotions can inherit from.
  1445. **Script Usage:**
  1446. > This is an abstract class that is to be inherited to a concrete class that provides object control locomotion functionality, therefore this script should not be directly used.
  1447. ### Inspector Parameters
  1448. * **Device For Direction:** The direction that will be moved in is the direction of this device.
  1449. * **Disable Other Controls On Active:** If this is checked then whenever the axis on the attached controller is being changed, all other object control scripts of the same type on other controllers will be disabled.
  1450. * **Affect On Falling:** If a `VRTK_BodyPhysics` script is present and this is checked, then the object control will affect the play area whilst it is falling.
  1451. * **Control Override Object:** An optional game object to apply the object control to. If this is blank then the PlayArea will be controlled.
  1452. * **Controller:** The controller to read the controller events from. If this is blank then it will attempt to get a controller events script from the same GameObject.
  1453. * **Body Physics:** An optional Body Physics script to check for potential collisions in the moving direction.
  1454. ### Class Variables
  1455. * `public enum DirectionDevices` - Devices for providing direction.
  1456. * `Headset` - The headset device.
  1457. * `LeftController` - The left controller device.
  1458. * `RightController` - The right controller device.
  1459. * `ControlledObject` - The controlled object.
  1460. ### Class Events
  1461. * `XAxisChanged` - Emitted when the X Axis Changes.
  1462. * `YAxisChanged` - Emitted when the Y Axis Changes.
  1463. ### Unity Events
  1464. Adding the `VRTK_ObjectControl_UnityEvents` component to `VRTK_ObjectControl` object allows access to `UnityEvents` that will react identically to the Class Events.
  1465. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  1466. ### Event Payload
  1467. * `GameObject controlledGameObject` - The GameObject that is going to be affected.
  1468. * `Transform directionDevice` - The device that is used for the direction.
  1469. * `Vector3 axisDirection` - The axis that is being affected.
  1470. * `Vector3 axis` - The value of the current touchpad touch point based across the axis direction.
  1471. * `float deadzone` - The value of the deadzone based across the axis direction.
  1472. * `bool currentlyFalling` - Whether the controlled GameObject is currently falling.
  1473. * `bool modifierActive` - Whether the modifier button is pressed.
  1474. ---
  1475. ## Touchpad Control (VRTK_TouchpadControl)
  1476. > extends [VRTK_ObjectControl](#object-control-vrtk_objectcontrol)
  1477. ### Overview
  1478. Provides the ability to control a GameObject's position based on the position of the controller touchpad axis.
  1479. > This script forms the stub of emitting the touchpad axis X and Y changes that are then digested by the corresponding Object Control Actions that are listening for the relevant event.
  1480. **Required Components:**
  1481. * `VRTK_ControllerEvents` - The Controller Events script to listen for the touchpad events on.
  1482. **Optional Components:**
  1483. * `VRTK_BodyPhysics` - The Body Physics script to utilise to determine if falling is occuring.
  1484. **Script Usage:**
  1485. * Place the `VRTK_TouchpadControl` script on either:
  1486. * The GameObject with the Controller Events script.
  1487. * Any other scene GameObject and provide a valid `VRTK_ControllerEvents` component to the `Controller` parameter of this script.
  1488. * Place a corresponding Object Control Action for the Touchpad Control script to notify of touchpad changes. Without a corresponding Object Control Action, the Touchpad Control script will do nothing.
  1489. ### Inspector Parameters
  1490. * **Coordinate Axis:** The axis to use for the direction coordinates.
  1491. * **Primary Activation Button:** An optional button that has to be engaged to allow the touchpad control to activate.
  1492. * **Action Modifier Button:** An optional button that when engaged will activate the modifier on the touchpad control action.
  1493. * **Axis Deadzone:** A deadzone threshold on the touchpad that will ignore input if the touch position is within the specified deadzone. Between `0f` and `1f`.
  1494. ### Example
  1495. `VRTK/Examples/017_CameraRig_TouchpadWalking` has a collection of walls and slopes that can be traversed by the user with the touchpad. There is also an area that can only be traversed if the user is crouching.
  1496. ---
  1497. ## Button Control (VRTK_ButtonControl)
  1498. > extends [VRTK_ObjectControl](#object-control-vrtk_objectcontrol)
  1499. ### Overview
  1500. Provides the ability to control a GameObject's position based the press of a controller button linked to a specific axis direction.
  1501. > This script forms the stub of emitting the axis X and Y changes that are then digested by the corresponding Object Control Actions that are listening for the relevant event.
  1502. **Required Components:**
  1503. * `VRTK_ControllerEvents` - The Controller Events script to listen for button presses events on.
  1504. **Optional Components:**
  1505. * `VRTK_BodyPhysics` - The Body Physics script to utilise to determine if falling is occuring.
  1506. **Script Usage:**
  1507. * Place the `VRTK_ButtonControl` script on either:
  1508. * The GameObject with the Controller Events script.
  1509. * Any other scene GameObject and provide a valid `VRTK_ControllerEvents` component to the `Controller` parameter of this script.
  1510. * Place a corresponding Object Control Action for the Button Control script to notify of axis changes. Without a corresponding Object Control Action, the Button Control script will do nothing.
  1511. ### Inspector Parameters
  1512. * **Forward Button:** The button to set the y axis to +1.
  1513. * **Backward Button:** The button to set the y axis to -1.
  1514. * **Left Button:** The button to set the x axis to -1.
  1515. * **Right Button:** The button to set the x axis to +1.
  1516. ---
  1517. ## Move In Place (VRTK_MoveInPlace)
  1518. ### Overview
  1519. Moves the SDK Camera Rig based on the motion of the headset and/or the controllers. Attempts to recreate the concept of physically walking on the spot to create scene movement.
  1520. > This locomotion method is based on Immersive Movement, originally created by Highsight. Thanks to KJack (author of Arm Swinger) for additional work.
  1521. **Optional Components:**
  1522. * `VRTK_BodyPhysics` - A Body Physics script to help determine potential collisions in the moving direction and prevent collision tunnelling.
  1523. **Script Usage:**
  1524. * Place the `VRTK_MoveInPlace` script on any active scene GameObject.
  1525. **Script Dependencies:**
  1526. * The Controller Events script on the controller Script Alias to determine when the engage button is pressed.
  1527. ### Inspector Parameters
  1528. * **Left Controller:** If this is checked then the left controller engage button will be enabled to move the play area.
  1529. * **Right Controller:** If this is checked then the right controller engage button will be enabled to move the play area.
  1530. * **Engage Button:** The button to press to activate the movement.
  1531. * **Control Options:** The device to determine the movement paramters from.
  1532. * **Direction Method:** The method in which to determine the direction of forward movement.
  1533. * **Speed Scale:** The speed in which to move the play area.
  1534. * **Max Speed:** The maximun speed in game units. (If 0 or less, max speed is uncapped)
  1535. * **Deceleration:** The speed in which the play area slows down to a complete stop when the engage button is released. This deceleration effect can ease any motion sickness that may be suffered.
  1536. * **Falling Deceleration:** The speed in which the play area slows down to a complete stop when falling is occuring.
  1537. * **Smart Decouple Threshold:** The degree threshold that all tracked objects (controllers, headset) must be within to change direction when using the Smart Decoupling Direction Method.
  1538. * **Sensitivity:** The maximum amount of movement required to register in the virtual world. Decreasing this will increase acceleration, and vice versa.
  1539. * **Body Physics:** An optional Body Physics script to check for potential collisions in the moving direction. If any potential collision is found then the move will not take place. This can help reduce collision tunnelling.
  1540. ### Class Variables
  1541. * `public enum ControlOptions` - Valid control options
  1542. * `HeadsetAndControllers` - Track both headset and controllers for movement calculations.
  1543. * `ControllersOnly` - Track only the controllers for movement calculations.
  1544. * `HeadsetOnly` - Track only headset for movement caluclations.
  1545. * `public enum DirectionalMethod` - Options for which method is used to determine direction while moving.
  1546. * `Gaze` - Will always move in the direction they are currently looking.
  1547. * `ControllerRotation` - Will move in the direction that the controllers are pointing (averaged).
  1548. * `DumbDecoupling` - Will move in the direction they were first looking when they engaged Move In Place.
  1549. * `SmartDecoupling` - Will move in the direction they are looking only if their headset point the same direction as their controllers.
  1550. * `EngageControllerRotationOnly` - Will move in the direction that the controller with the engage button pressed is pointing.
  1551. * `LeftControllerRotationOnly` - Will move in the direction that the left controller is pointing.
  1552. * `RightControllerRotationOnly` - Will move in the direction that the right controller is pointing.
  1553. ### Class Methods
  1554. #### SetControlOptions/1
  1555. > `public virtual void SetControlOptions(ControlOptions givenControlOptions)`
  1556. * Parameters
  1557. * `ControlOptions givenControlOptions` - The control options to set the current control options to.
  1558. * Returns
  1559. * _none_
  1560. Set the control options and modify the trackables to match.
  1561. #### GetMovementDirection/0
  1562. > `public virtual Vector3 GetMovementDirection()`
  1563. * Parameters
  1564. * _none_
  1565. * Returns
  1566. * `Vector3` - Returns a Vector3 representing the current movement direction.
  1567. The GetMovementDirection method will return the direction the play area is currently moving in.
  1568. #### GetSpeed/0
  1569. > `public virtual float GetSpeed()`
  1570. * Parameters
  1571. * _none_
  1572. * Returns
  1573. * `float` - Returns a float representing the current movement speed.
  1574. The GetSpeed method will return the current speed the play area is moving at.
  1575. ### Example
  1576. `VRTK/Examples/042_CameraRig_MoveInPlace` demonstrates how the user can move and traverse colliders by either swinging the controllers in a walking fashion or by running on the spot utilisng the head bob for movement.
  1577. ---
  1578. ## Player Climb (VRTK_PlayerClimb)
  1579. ### Overview
  1580. Provides the ability for the SDK Camera Rig to be moved around based on whether an Interact Grab is interacting with a Climbable Interactable Object to simulate climbing.
  1581. **Required Components:**
  1582. * `VRTK_BodyPhysics` - A Body Physics script to deal with the effects of physics and gravity on the play area.
  1583. **Optional Components:**
  1584. * `VRTK_BasicTeleport` - A Teleporter script to use when snapping the play area to the nearest floor when releasing from grab.
  1585. * `VRTK_HeadsetCollision` - A Headset Collision script to determine when the headset is colliding with geometry to know when to reset to a valid location.
  1586. * `VRTK_PositionRewind` - A Position Rewind script to utilise when resetting to a valid location upon ungrabbing whilst colliding with geometry.
  1587. **Script Usage:**
  1588. * Place the `VRTK_PlayerClimb` script on any active scene GameObject.
  1589. **Script Dependencies:**
  1590. * The controller Script Alias GameObject requires the Interact Touch and Interact Grab scripts to allow for touching and grabbing of Interactable Objects.
  1591. * An Interactable Object in the scene that has the Climbable Grab Attach Mechanic.
  1592. ### Inspector Parameters
  1593. * **Use Player Scale:** Will scale movement up and down based on the player transform's scale.
  1594. * **Body Physics:** The Body Physics script to use for dealing with climbing and falling. If this is left blank then the script will need to be applied to the same GameObject.
  1595. * **Teleporter:** The Teleport script to use when snapping to nearest floor on release. If this is left blank then a Teleport script will need to be applied to the same GameObject.
  1596. * **Headset Collision:** The Headset Collision script to use for determining if the user is climbing inside a collidable object. If this is left blank then the script will need to be applied to the same GameObject.
  1597. * **Position Rewind:** The Position Rewind script to use for dealing resetting invalid positions. If this is left blank then the script will need to be applied to the same GameObject.
  1598. ### Class Events
  1599. * `PlayerClimbStarted` - Emitted when player climbing has started.
  1600. * `PlayerClimbEnded` - Emitted when player climbing has ended.
  1601. ### Unity Events
  1602. Adding the `VRTK_PlayerClimb_UnityEvents` component to `VRTK_PlayerClimb` object allows access to `UnityEvents` that will react identically to the Class Events.
  1603. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  1604. ### Event Payload
  1605. * `VRTK_ControllerReference controllerReference` - The reference to the controller doing the interaction.
  1606. * `GameObject target` - The GameObject of the interactable object that is being interacted with by the controller.
  1607. ### Class Methods
  1608. #### IsClimbing/0
  1609. > `public virtual bool IsClimbing()`
  1610. * Parameters
  1611. * _none_
  1612. * Returns
  1613. * `bool` - Returns `true` if climbing is currently taking place.
  1614. The IsClimbing method will return if climbing is currently taking place or not.
  1615. ### Example
  1616. `VRTK/Examples/037_CameraRig_ClimbingFalling` shows how to set up a scene with player climbing. There are many different examples showing how the same system can be used in unique ways.
  1617. ---
  1618. ## Slingshot Jump (VRTK_SlingshotJump)
  1619. ### Overview
  1620. Provides the ability for the SDK Camera Rig to be thrown around with a jumping motion by slingshotting based on the pull back of each valid controller.
  1621. **Required Components:**
  1622. * `VRTK_PlayerClimb` - A Player Climb script for dealing with the physical throwing of the play area as if throwing off an invisible climbed object.
  1623. * `VRTK_BodyPhysics` - A Body Physics script to deal with the effects of physics and gravity on the play area.
  1624. **Optional Components:**
  1625. * `VRTK_BasicTeleport` - A Teleporter script to use when snapping the play area to the nearest floor when releasing from grab.
  1626. * `VRTK_HeadsetCollision` - A Headset Collision script to determine when the headset is colliding with geometry to know when to reset to a valid location.
  1627. * `VRTK_PositionRewind` - A Position Rewind script to utilise when resetting to a valid location upon ungrabbing whilst colliding with geometry.
  1628. **Script Usage:**
  1629. * Place the `VRTK_SlingshotJump` script on the same GameObject as the `VRTK_PlayerClimb` script.
  1630. ### Inspector Parameters
  1631. * **Release Window Time:** How close together the button releases have to be to initiate a jump.
  1632. * **Velocity Multiplier:** Multiplier that increases the jump strength.
  1633. * **Velocity Max:** The maximum velocity a jump can be.
  1634. ### Class Events
  1635. * `SlingshotJumped` - Emitted when a slingshot jump occurs
  1636. ### Unity Events
  1637. Adding the `VRTK_SlingshotJump_UnityEvents` component to `VRTK_SlingshotJump` object allows access to `UnityEvents` that will react identically to the Class Events.
  1638. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  1639. ### Class Methods
  1640. #### GetActivationButton/0
  1641. > `public virtual VRTK_ControllerEvents.ButtonAlias GetActivationButton()`
  1642. * Parameters
  1643. * _none_
  1644. * Returns
  1645. * `VRTK_ControllerEvents.ButtonAlias` - Returns the button used for slingshot activation.
  1646. The SetActivationButton method gets the button used to activate a slingshot jump.
  1647. #### SetActivationButton/1
  1648. > `public virtual void SetActivationButton(VRTK_ControllerEvents.ButtonAlias button)`
  1649. * Parameters
  1650. * `VRTK_ControllerEvents.ButtonAlias button` - The controller button to use to activate the jump.
  1651. * Returns
  1652. * _none_
  1653. The SetActivationButton method sets the button used to activate a slingshot jump.
  1654. #### GetCancelButton/0
  1655. > `public virtual VRTK_ControllerEvents.ButtonAlias GetCancelButton()`
  1656. * Parameters
  1657. * _none_
  1658. * Returns
  1659. * `VRTK_ControllerEvents.ButtonAlias` - Returns the button used to cancel a slingshot jump.
  1660. The GetCancelButton method gets the button used to cancel a slingshot jump.
  1661. #### SetCancelButton/1
  1662. > `public virtual void SetCancelButton(VRTK_ControllerEvents.ButtonAlias button)`
  1663. * Parameters
  1664. * `VRTK_ControllerEvents.ButtonAlias button` - The controller button to use to cancel the jump.
  1665. * Returns
  1666. * _none_
  1667. The SetCancelButton method sets the button used to cancel a slingshot jump.
  1668. ### Example
  1669. `VRTK/Examples/037_CameraRig_ClimbingFalling` shows how to set up a scene with slingshot jumping. This script just needs to be added to the PlayArea object and the requested forces and buttons set.
  1670. ---
  1671. ## Step Multiplier (VRTK_StepMultiplier)
  1672. ### Overview
  1673. Multiplies each real world step within the play area to enable further distances to be travelled in the virtual world.
  1674. **Optional Components:**
  1675. * `VRTK_ControllerEvents` - The events component to listen for the button presses on. This must be applied on the same GameObject as this script if one is not provided via the `Controller Events` parameter.
  1676. **Script Usage:**
  1677. * Place the `VRTK_StepMultiplier` script on either:
  1678. * Any GameObject in the scene if no activation button is required.
  1679. * The GameObject with the Controller Events scripts if an activation button is required.
  1680. * Any other scene GameObject and provide a valid `VRTK_ControllerEvents` component to the `Controller Events` parameter of this script if an activation button is required.
  1681. ### Inspector Parameters
  1682. * **Activation Button:** The controller button to activate the step multiplier effect. If it is `Undefined` then the step multiplier will always be active.
  1683. * **Movement Function:** This determines the type of movement used by the extender.
  1684. * **Additional Movement Multiplier:** This is the factor by which movement at the edge of the circle is amplified. `0` is no movement of the play area. Higher values simulate a bigger play area but may be too uncomfortable.
  1685. * **Head Zone Radius:** This is the size of the circle in which the play area is not moved and everything is normal. If it is to low it becomes uncomfortable when crouching.
  1686. * **Controller Events:** The Controller Events to listen for the events on. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  1687. ### Class Variables
  1688. * `public enum MovementFunction` - Movement methods.
  1689. * `Nonlinear` - Moves the head with a non-linear drift movement.
  1690. * `LinearDirect` - Moves the headset in a direct linear movement.
  1691. ### Example
  1692. `VRTK/Examples/028_CameraRig_RoomExtender` shows how the Step Multiplier can be used to move around the scene with multiplied steps.
  1693. ---
  1694. ## Tunnel Overlay (VRTK_TunnelOverlay)
  1695. ### Overview
  1696. Applys a tunnel overlay effect to the active VR camera when the play area is moving or rotating to reduce potential nausea caused by simulation sickness.
  1697. **Script Usage:**
  1698. * Place the `VRTK_TunnelOverlay` script on any active scene GameObject.
  1699. > This implementation is based on a project made by SixWays at https://github.com/SixWays/UnityVrTunnelling
  1700. ### Inspector Parameters
  1701. * **Minimum Rotation:** Minimum rotation speed for the effect to activate (degrees per second).
  1702. * **Maximum Rotation:** Maximum rotation speed for the effect have its max settings applied (degrees per second).
  1703. * **Minimum Speed:** Minimum movement speed for the effect to activate.
  1704. * **Maximum Speed:** Maximum movement speed where the effect will have its max settings applied.
  1705. * **Effect Color:** The color to use for the tunnel effect.
  1706. * **Effect Skybox:** An optional skybox texture to use for the tunnel effect.
  1707. * **Initial Effect Size:** The initial amount of screen coverage the tunnel to consume without any movement.
  1708. * **Maximum Effect Size:** Screen coverage at the maximum tracked values.
  1709. * **Feather Size:** Feather effect size around the cut-off as fraction of screen.
  1710. * **Smoothing Time:** Smooth out radius over time.
  1711. ---
  1712. ## Drag World (VRTK_DragWorld)
  1713. ### Overview
  1714. Provides the ability to move, rotate and scale the PlayArea by dragging the world with the controllers.
  1715. **Script Usage:**
  1716. * Place the `VRTK_DragWorld` script on any active scene GameObject.
  1717. > If only one controller is being used to track the rotation mechanism, then the rotation will be based on the perpendicual (yaw) axis angular velocity of the tracking controller.
  1718. > If both controllers are being used to track the rotation mechanism, then the rotation will be based on pushing one controller forward, whilst pulling the other controller backwards.
  1719. ### Inspector Parameters
  1720. * **Movement Activation Button:** The controller button to press to activate the movement mechanism.
  1721. * **Movement Activation Requirement:** The controller(s) on which the activation button is to be pressed to consider the movement mechanism active.
  1722. * **Movement Tracking Controller:** The controller(s) on which to track position of to determine if a valid move has taken place.
  1723. * **Movement Multiplier:** The amount to multply the movement by.
  1724. * **Movement Position Lock:** The axes to lock to prevent movement across.
  1725. * **Rotation Activation Button:** The controller button to press to activate the rotation mechanism.
  1726. * **Rotation Activation Requirement:** The controller(s) on which the activation button is to be pressed to consider the rotation mechanism active.
  1727. * **Rotation Tracking Controller:** The controller(s) on which to determine how rotation should occur. `BothControllers` requires both controllers to be pushed/pulled to rotate, whereas any other setting will base rotation on the rotation of the activating controller.
  1728. * **Rotation Multiplier:** The amount to multply the rotation angle by.
  1729. * **Rotation Activation Threshold:** The threshold the rotation angle has to be above to consider a valid rotation amount.
  1730. * **Scale Activation Button:** The controller button to press to activate the scale mechanism.
  1731. * **Scale Activation Requirement:** The controller(s) on which the activation button is to be pressed to consider the scale mechanism active.
  1732. * **Scale Tracking Controller:** The controller(s) on which to determine how scaling should occur.
  1733. * **Scale Multiplier:** The amount to multply the scale factor by.
  1734. * **Scale Activation Threshold:** The threshold the distance between the scale objects has to be above to consider a valid scale operation.
  1735. * **Minimum Scale:** the minimum scale amount that can be applied.
  1736. * **Maximum Scale:** the maximum scale amount that can be applied.
  1737. * **Controlling Transform:** The transform to apply the control mechanisms to. If this is left blank then the PlayArea will be controlled.
  1738. * **Use Offset Transform:** Uses the specified `Offset Transform` when dealing with rotational offsets.
  1739. * **Offset Transform:** The transform to use when dealing with rotational offsets. If this is left blank then the Headset will be used as the offset.
  1740. ### Class Variables
  1741. * `public enum ActivationRequirement` - The controller on which to determine as the activation requirement for the control mechanism.
  1742. * `LeftControllerOnly` - Only pressing the activation button on the left controller will activate the mechanism, if the right button is held down then the mechanism will not be activated.
  1743. * `RightControllerOnly` - Only pressing the activation button on the right controller will activate the mechanism, if the left button is held down then the mechanism will not be activated.
  1744. * `LeftController` - Pressing the activation button on the left controller is all that is required to activate the mechanism.
  1745. * `RightController` - Pressing the activation button on the right controller is all that is required to activate the mechanism.
  1746. * `EitherController` - Pressing the activation button on the either controller is all that is required to activate the mechanism.
  1747. * `BothControllers` - Pressing the activation button on both controllers is required to activate the mechanism.
  1748. * `public enum TrackingController` - The controllers which to track when performing the mechanism.
  1749. * `LeftController` - Only track the left controller.
  1750. * `RightController` - Only track the right controller.
  1751. * `EitherController` - Track either the left or the right controller.
  1752. * `BothControllers` - Only track both controllers at the same time.
  1753. ---
  1754. # Object Control Actions (VRTK/Source/Scripts/Locomotion/ObjectControlActions)
  1755. A collection of scripts that are used to provide different actions when using Object Control.
  1756. * [Base Object Control Action](#base-object-control-action-vrtk_baseobjectcontrolaction)
  1757. * [Slide Object Control Action](#slide-object-control-action-vrtk_slideobjectcontrolaction)
  1758. * [Rotate Object Control Action](#rotate-object-control-action-vrtk_rotateobjectcontrolaction)
  1759. * [Snap Rotate Object Control Action](#snap-rotate-object-control-action-vrtk_snaprotateobjectcontrolaction)
  1760. * [Warp Object Control Action](#warp-object-control-action-vrtk_warpobjectcontrolaction)
  1761. ---
  1762. ## Base Object Control Action (VRTK_BaseObjectControlAction)
  1763. ### Overview
  1764. Provides a base that all object control actions can inherit from.
  1765. **Script Usage:**
  1766. > This is an abstract class that is to be inherited to a concrete class that provides object control action functionality, therefore this script should not be directly used.
  1767. ### Inspector Parameters
  1768. * **Object Control Script:** The Object Control script to receive axis change events from.
  1769. * **Listen On Axis Change:** Determines which Object Control Axis event to listen to.
  1770. ### Class Variables
  1771. * `public enum AxisListeners` - The axis to listen to changes on.
  1772. * `XAxisChanged` - Listen for changes on the horizontal X axis.
  1773. * `YAxisChanged` - Listen for changes on the vertical y axis.
  1774. ---
  1775. ## Slide Object Control Action (VRTK_SlideObjectControlAction)
  1776. > extends [VRTK_BaseObjectControlAction](#base-object-control-action-vrtk_baseobjectcontrolaction)
  1777. ### Overview
  1778. Provides the ability to move a GameObject around by sliding it across the `x/z` plane in the scene by updating the Transform position when the corresponding Object Control axis changes.
  1779. > The effect is a smooth sliding motion in forward and sideways directions to simulate walking.
  1780. **Required Components:**
  1781. * `VRTK_ObjectControl` - The Object Control script to listen for the axis changes on.
  1782. **Optional Components:**
  1783. * `VRTK_BodyPhysics` - The Body Physics script to utilise when checking for potential collisions on movement.
  1784. **Script Usage:**
  1785. * Place the `VRTK_SlideObjectControlAction` script on any active scene GameObject.
  1786. * Link the required Object Control script to the `Object Control Script` parameter of this script.
  1787. * Set the `Listen On Axis Change` parameter on this script to the axis change to affect with this movement type.
  1788. ### Inspector Parameters
  1789. * **Maximum Speed:** The maximum speed the controlled object can be moved in based on the position of the axis.
  1790. * **Deceleration:** The rate of speed deceleration when the axis is no longer being changed.
  1791. * **Falling Deceleration:** The rate of speed deceleration when the axis is no longer being changed and the object is falling.
  1792. * **Speed Multiplier:** The speed multiplier to be applied when the modifier button is pressed.
  1793. * **Body Physics:** An optional Body Physics script to check for potential collisions in the moving direction. If any potential collision is found then the move will not take place. This can help reduce collision tunnelling.
  1794. ### Example
  1795. `VRTK/Examples/017_CameraRig_TouchpadWalking` has a collection of walls and slopes that can be traversed by the user with the touchpad. There is also an area that can only be traversed if the user is crouching.
  1796. To enable the Slide Object Control Action, ensure one of the `TouchpadControlOptions` children (located under the Controller script alias) has the `Slide` control script active.
  1797. ---
  1798. ## Rotate Object Control Action (VRTK_RotateObjectControlAction)
  1799. > extends [VRTK_BaseObjectControlAction](#base-object-control-action-vrtk_baseobjectcontrolaction)
  1800. ### Overview
  1801. Provides the ability to rotate a GameObject through the world `y` axis in the scene by updating the Transform rotation when the corresponding Object Control axis changes.
  1802. > The effect is a smooth rotation to simulate turning.
  1803. **Required Components:**
  1804. * `VRTK_ObjectControl` - The Object Control script to listen for the axis changes on.
  1805. **Script Usage:**
  1806. * Place the `VRTK_RotateObjectControlAction` script on any active scene GameObject.
  1807. * Link the required Object Control script to the `Object Control Script` parameter of this script.
  1808. * Set the `Listen On Axis Change` parameter on this script to the axis change to affect with this movement type.
  1809. ### Inspector Parameters
  1810. * **Maximum Rotation Speed:** The maximum speed the controlled object can be rotated based on the position of the axis.
  1811. * **Rotation Multiplier:** The rotation multiplier to be applied when the modifier button is pressed.
  1812. ### Example
  1813. `VRTK/Examples/017_CameraRig_TouchpadWalking` has a collection of walls and slopes that can be traversed by the user with the touchpad. There is also an area that can only be traversed if the user is crouching.
  1814. To enable the Rotate Object Control Action, ensure one of the `TouchpadControlOptions` children (located under the Controller script alias) has the `Rotate` control script active.
  1815. ---
  1816. ## Snap Rotate Object Control Action (VRTK_SnapRotateObjectControlAction)
  1817. > extends [VRTK_BaseObjectControlAction](#base-object-control-action-vrtk_baseobjectcontrolaction)
  1818. ### Overview
  1819. Provides the ability to snap rotate a GameObject through the world `y` axis in the scene by updating the Transform rotation in defined steps when the corresponding Object Control axis changes.
  1820. > The effect is a immediate snap rotation to quickly face in a new direction.
  1821. **Required Components:**
  1822. * `VRTK_ObjectControl` - The Object Control script to listen for the axis changes on.
  1823. **Script Usage:**
  1824. * Place the `VRTK_SnapRotateObjectControlAction` script on any active scene GameObject.
  1825. * Link the required Object Control script to the `Object Control Script` parameter of this script.
  1826. * Set the `Listen On Axis Change` parameter on this script to the axis change to affect with this movement type.
  1827. ### Inspector Parameters
  1828. * **Angle Per Snap:** The angle to rotate for each snap.
  1829. * **Angle Multiplier:** The snap angle multiplier to be applied when the modifier button is pressed.
  1830. * **Snap Delay:** The amount of time required to pass before another snap rotation can be carried out.
  1831. * **Blink Transition Speed:** The speed for the headset to fade out and back in. Having a blink between rotations can reduce nausia.
  1832. * **Axis Threshold:** The threshold the listened axis needs to exceed before the action occurs. This can be used to limit the snap rotate to a single axis direction (e.g. pull down to flip rotate). The threshold is ignored if it is 0.
  1833. ### Example
  1834. `VRTK/Examples/017_CameraRig_TouchpadWalking` has a collection of walls and slopes that can be traversed by the user with the touchpad. There is also an area that can only be traversed if the user is crouching.
  1835. To enable the Snap Rotate Object Control Action, ensure one of the `TouchpadControlOptions` children (located under the Controller script alias) has the `Snap Rotate` control script active.
  1836. ---
  1837. ## Warp Object Control Action (VRTK_WarpObjectControlAction)
  1838. > extends [VRTK_BaseObjectControlAction](#base-object-control-action-vrtk_baseobjectcontrolaction)
  1839. ### Overview
  1840. Provides the ability to move a GameObject around by warping it across the `x/z` plane in the scene by updating the Transform position in defined steps when the corresponding Object Control axis changes.
  1841. > The effect is a immediate snap to a new position in the given direction.
  1842. **Required Components:**
  1843. * `VRTK_ObjectControl` - The Object Control script to listen for the axis changes on.
  1844. **Optional Components:**
  1845. * `VRTK_BodyPhysics` - The Body Physics script to utilise when checking for potential collisions on movement.
  1846. **Script Usage:**
  1847. * Place the `VRTK_WarpObjectControlAction` script on any active scene GameObject.
  1848. * Link the required Object Control script to the `Object Control Script` parameter of this script.
  1849. * Set the `Listen On Axis Change` parameter on this script to the axis change to affect with this movement type.
  1850. ### Inspector Parameters
  1851. * **Warp Distance:** The distance to warp in the facing direction.
  1852. * **Warp Multiplier:** The multiplier to be applied to the warp when the modifier button is pressed.
  1853. * **Warp Delay:** The amount of time required to pass before another warp can be carried out.
  1854. * **Floor Height Tolerance:** The height different in floor allowed to be a valid warp.
  1855. * **Blink Transition Speed:** The speed for the headset to fade out and back in. Having a blink between warps can reduce nausia.
  1856. * **Body Physics:** An optional Body Physics script to check for potential collisions in the moving direction. If any potential collision is found then the move will not take place. This can help reduce collision tunnelling.
  1857. ### Example
  1858. `VRTK/Examples/017_CameraRig_TouchpadWalking` has a collection of walls and slopes that can be traversed by the user with the touchpad. There is also an area that can only be traversed if the user is crouching.
  1859. To enable the Warp Object Control Action, ensure one of the `TouchpadControlOptions` children (located under the Controller script alias) has the `Warp` control script active.
  1860. ---
  1861. # Highlighters (VRTK/Source/Scripts/Interactions/Highlighters)
  1862. A collection of scripts that are used to provide highlighting.
  1863. * [Base Highlighter](#base-highlighter-vrtk_basehighlighter)
  1864. * [Material Colour Swap](#material-colour-swap-vrtk_materialcolorswaphighlighter)
  1865. * [Material Property Block Colour Swap](#material-property-block-colour-swap-vrtk_materialpropertyblockcolorswaphighlighter)
  1866. * [Outline Object Copy](#outline-object-copy-vrtk_outlineobjectcopyhighlighter)
  1867. ---
  1868. ## Base Highlighter (VRTK_BaseHighlighter)
  1869. ### Overview
  1870. Provides a base that all highlighters can inherit from.
  1871. **Script Usage:**
  1872. > This is an abstract class that is to be inherited to a concrete class that provides highlight functionality, therefore this script should not be directly used.
  1873. ### Inspector Parameters
  1874. * **Active:** Determines if this highlighter is the active highlighter for the object the component is attached to. Only one active highlighter can be applied to a GameObject.
  1875. * **Unhighlight On Disable:** Determines if the highlighted object should be unhighlighted when it is disabled.
  1876. ### Class Methods
  1877. #### Initialise/3
  1878. > `public abstract void Initialise(Color? color = null, GameObject affectObject = null, Dictionary<string, object> options = null);`
  1879. * Parameters
  1880. * `Color? color` - An optional colour may be passed through at point of initialisation in case the highlighter requires it.
  1881. * `GameObject affectObject` - An optional GameObject to specify which object to apply the highlighting to.
  1882. * `Dictionary<string, object> options` - An optional dictionary of highlighter specific options that may be differ with highlighter implementations.
  1883. * Returns
  1884. * _none_
  1885. The Initalise method is used to set up the state of the highlighter.
  1886. #### ResetHighlighter/0
  1887. > `public abstract void ResetHighlighter();`
  1888. * Parameters
  1889. * _none_
  1890. * Returns
  1891. * _none_
  1892. The ResetHighlighter method is used to reset the highlighter if anything on the object has changed. It should be called by any scripts changing object materials or colours.
  1893. #### Highlight/2
  1894. > `public abstract void Highlight(Color? color = null, float duration = 0f);`
  1895. * Parameters
  1896. * `Color? color` - An optional colour to highlight the game object to. The highlight colour may already have been set in the `Initialise` method so may not be required here.
  1897. * `float duration` - An optional duration of how long before the highlight has occured. It can be used by highlighters to fade the colour if possible.
  1898. * Returns
  1899. * _none_
  1900. The Highlight method is used to initiate the highlighting logic to apply to an object.
  1901. #### Unhighlight/2
  1902. > `public abstract void Unhighlight(Color? color = null, float duration = 0f);`
  1903. * Parameters
  1904. * `Color? color` - An optional colour that could be used during the unhighlight phase. Usually will be left as null.
  1905. * `float duration` - An optional duration of how long before the unhighlight has occured.
  1906. * Returns
  1907. * _none_
  1908. The Unhighlight method is used to initiate the logic that returns an object back to it's original appearance.
  1909. #### GetOption<T>/2
  1910. > `public virtual T GetOption<T>(Dictionary<string, object> options, string key)`
  1911. * Type Params
  1912. * `T` - The system type that is expected to be returned.
  1913. * Parameters
  1914. * `Dictionary<string, object> options` - The dictionary of options to check in.
  1915. * `string key` - The identifier key to look for.
  1916. * Returns
  1917. * `T` - The value in the options at the given key returned in the provided system type.
  1918. The GetOption method is used to return a value from the options array if the given key exists.
  1919. #### UsesClonedObject/0
  1920. > `public virtual bool UsesClonedObject()`
  1921. * Parameters
  1922. * _none_
  1923. * Returns
  1924. * `bool` - Returns `true` if the highlighter creates a cloned object to apply the highlighter on, returns `false` if no additional object is created.
  1925. The UsesClonedObject method is used to return whether the current highlighter creates a cloned object to do the highlighting with.
  1926. #### GetActiveHighlighter/1
  1927. > `public static VRTK_BaseHighlighter GetActiveHighlighter(GameObject obj)`
  1928. * Parameters
  1929. * `GameObject obj` - The GameObject to check for a highlighter on.
  1930. * Returns
  1931. * `VRTK_BaseHighlighter` - A valid and active highlighter.
  1932. The GetActiveHighlighter method checks the given GameObject for a valid and active highlighter.
  1933. ---
  1934. ## Material Colour Swap (VRTK_MaterialColorSwapHighlighter)
  1935. > extends [VRTK_BaseHighlighter](#base-highlighter-vrtk_basehighlighter)
  1936. ### Overview
  1937. Swaps the texture colour on the Renderers material for the given highlight colour.
  1938. > Due to the way the object material is interacted with, changing the material colour will break Draw Call Batching in Unity whilst the object is highlighted. The Draw Call Batching will resume on the original material when the item is no longer highlighted.
  1939. **Script Usage:**
  1940. * Place the `VRTK_MaterialColorSwapHighlighter` script on either:
  1941. * The GameObject of the Interactable Object to highlight.
  1942. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Object Highlighter` parameter to denote use of the highlighter.
  1943. * Ensure the `Active` parameter is checked.
  1944. ### Inspector Parameters
  1945. * **Emission Darken:** The emission colour of the texture will be the highlight colour but this percent darker.
  1946. * **Custom Material:** A custom material to use on the highlighted object.
  1947. ### Class Methods
  1948. #### Initialise/3
  1949. > `public override void Initialise(Color? color = null, GameObject affectObject = null, Dictionary<string, object> options = null)`
  1950. * Parameters
  1951. * `Color? color` - Not used.
  1952. * `GameObject affectObject` - An optional GameObject to specify which object to apply the highlighting to.
  1953. * `Dictionary<string, object> options` - A dictionary array containing the highlighter options:
  1954. * `<'resetMainTexture', bool>` - Determines if the default main texture should be cleared on highlight. `true` to reset the main default texture, `false` to not reset it.
  1955. * Returns
  1956. * _none_
  1957. The Initialise method sets up the highlighter for use.
  1958. #### ResetHighlighter/0
  1959. > `public override void ResetHighlighter()`
  1960. * Parameters
  1961. * _none_
  1962. * Returns
  1963. * _none_
  1964. The ResetHighlighter method stores the object's materials and shared materials prior to highlighting.
  1965. #### Highlight/2
  1966. > `public override void Highlight(Color? color, float duration = 0f)`
  1967. * Parameters
  1968. * `Color? color` - The colour to highlight to.
  1969. * `float duration` - The time taken to fade to the highlighted colour.
  1970. * Returns
  1971. * _none_
  1972. The Highlight method initiates the change of colour on the object and will fade to that colour (from a base white colour) for the given duration.
  1973. #### Unhighlight/2
  1974. > `public override void Unhighlight(Color? color = null, float duration = 0f)`
  1975. * Parameters
  1976. * `Color? color` - Not used.
  1977. * `float duration` - Not used.
  1978. * Returns
  1979. * _none_
  1980. The Unhighlight method returns the object back to it's original colour.
  1981. ### Example
  1982. `VRTK/Examples/005_Controller_BasicObjectGrabbing` demonstrates the solid highlighting on the green cube, red cube and flying saucer when the controller touches it.
  1983. `VRTK/Examples/035_Controller_OpacityAndHighlighting` demonstrates the solid highlighting if the right controller collides with the green box or if any of the buttons are pressed.
  1984. ---
  1985. ## Material Property Block Colour Swap (VRTK_MaterialPropertyBlockColorSwapHighlighter)
  1986. > extends [VRTK_MaterialColorSwapHighlighter](#material-colour-swap-vrtk_materialcolorswaphighlighter)
  1987. ### Overview
  1988. Swaps the texture colour on the Renderers material for the given highlight colour using property blocks.
  1989. > Utilising the MaterialPropertyBlock means that Draw Call Batching in Unity is not compromised.
  1990. **Script Usage:**
  1991. * Place the `VRTK_MaterialPropertyBlockColorSwapHighlighter` script on either:
  1992. * The GameObject of the Interactable Object to highlight.
  1993. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Object Highlighter` parameter to denote use of the highlighter.
  1994. * Ensure the `Active` parameter is checked.
  1995. ### Class Methods
  1996. #### Initialise/3
  1997. > `public override void Initialise(Color? color = null, GameObject affectObject = null, Dictionary<string, object> options = null)`
  1998. * Parameters
  1999. * `Color? color` - Not used.
  2000. * `GameObject affectObject` - An optional GameObject to specify which object to apply the highlighting to.
  2001. * `Dictionary<string, object> options` - A dictionary array containing the highlighter options:
  2002. * `<'resetMainTexture', bool>` - Determines if the default main texture should be cleared on highlight. `true` to reset the main default texture, `false` to not reset it.
  2003. * Returns
  2004. * _none_
  2005. The Initialise method sets up the highlighter for use.
  2006. #### Unhighlight/2
  2007. > `public override void Unhighlight(Color? color = null, float duration = 0f)`
  2008. * Parameters
  2009. * `Color? color` - Not used.
  2010. * `float duration` - Not used.
  2011. * Returns
  2012. * _none_
  2013. The Unhighlight method returns the object back to it's original colour.
  2014. ---
  2015. ## Outline Object Copy (VRTK_OutlineObjectCopyHighlighter)
  2016. > extends [VRTK_BaseHighlighter](#base-highlighter-vrtk_basehighlighter)
  2017. ### Overview
  2018. Creates a mesh copy and applies an outline shader which is toggled on and off when highlighting the object.
  2019. > A valid mesh must be found or provided for the clone mesh to be created.
  2020. **Script Usage:**
  2021. * Place the `VRTK_OutlineObjectCopyHighlighter` script on either:
  2022. * The GameObject of the Interactable Object to highlight.
  2023. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Object Highlighter` parameter to denote use of the highlighter.
  2024. * Ensure the `Active` parameter is checked.
  2025. ### Inspector Parameters
  2026. * **Thickness:** The thickness of the outline effect
  2027. * **Custom Outline Models:** The GameObjects to use as the model to outline. If one isn't provided then the first GameObject with a valid Renderer in the current GameObject hierarchy will be used.
  2028. * **Custom Outline Model Paths:** A path to a GameObject to find at runtime, if the GameObject doesn't exist at edit time.
  2029. * **Enable Submesh Highlight:** If the mesh has multiple sub-meshes to highlight then this should be checked, otherwise only the first mesh will be highlighted.
  2030. ### Class Methods
  2031. #### Initialise/3
  2032. > `public override void Initialise(Color? color = null, GameObject affectObject = null, Dictionary<string, object> options = null)`
  2033. * Parameters
  2034. * `Color? color` - Not used.
  2035. * `GameObject affectObject` - An optional GameObject to specify which object to apply the highlighting to.
  2036. * `Dictionary<string, object> options` - A dictionary array containing the highlighter options:
  2037. * `<'thickness', float>` - Same as `thickness` inspector parameter.
  2038. * `<'customOutlineModels', GameObject[]>` - Same as `customOutlineModels` inspector parameter.
  2039. * `<'customOutlineModelPaths', string[]>` - Same as `customOutlineModelPaths` inspector parameter.
  2040. * Returns
  2041. * _none_
  2042. The Initialise method sets up the highlighter for use.
  2043. #### ResetHighlighter/0
  2044. > `public override void ResetHighlighter()`
  2045. * Parameters
  2046. * _none_
  2047. * Returns
  2048. * _none_
  2049. The ResetHighlighter method creates the additional model to use as the outline highlighted object.
  2050. #### Highlight/2
  2051. > `public override void Highlight(Color? color, float duration = 0f)`
  2052. * Parameters
  2053. * `Color? color` - The colour to outline with.
  2054. * `float duration` - Not used.
  2055. * Returns
  2056. * _none_
  2057. The Highlight method initiates the outline object to be enabled and display the outline colour.
  2058. #### Unhighlight/2
  2059. > `public override void Unhighlight(Color? color = null, float duration = 0f)`
  2060. * Parameters
  2061. * `Color? color` - Not used.
  2062. * `float duration` - Not used.
  2063. * Returns
  2064. * _none_
  2065. The Unhighlight method hides the outline object and removes the outline colour.
  2066. ### Example
  2067. `VRTK/Examples/005_Controller_BasicObjectGrabbing` demonstrates the outline highlighting on the green sphere when the controller touches it.
  2068. `VRTK/Examples/035_Controller_OpacityAndHighlighting` demonstrates the outline highlighting if the left controller collides with the green box.
  2069. ---
  2070. # Interactors (VRTK/Source/Scripts/Interactions/Interactors)
  2071. A collection of scripts that provide the ability denote objects (such as controllers) as being able to interact with interactable objects.
  2072. * [Controller Events](#controller-events-vrtk_controllerevents)
  2073. * [Interact Touch](#interact-touch-vrtk_interacttouch)
  2074. * [Interact Near Touch](#interact-near-touch-vrtk_interactneartouch)
  2075. * [Interact Grab](#interact-grab-vrtk_interactgrab)
  2076. * [Interact Use](#interact-use-vrtk_interactuse)
  2077. * [Controller Tracked Collider](#controller-tracked-collider-vrtk_controllertrackedcollider)
  2078. * [Controller Highlighter](#controller-highlighter-vrtk_controllerhighlighter)
  2079. * [Object Auto Grab](#object-auto-grab-vrtk_objectautograb)
  2080. ---
  2081. ## Controller Events (VRTK_ControllerEvents)
  2082. ### Overview
  2083. A relationship to a physical VR controller and emits events based on the inputs of the controller.
  2084. **Script Usage:**
  2085. * Place the `VRTK_ControllerEvents` script on the controller script alias GameObject of the controller to track (e.g. Right Controller Script Alias).
  2086. ### Inspector Parameters
  2087. * **Axis Fidelity:** The amount of fidelity in the changes on the axis, which is defaulted to 1. Any number higher than 2 will probably give too sensitive results.
  2088. * **Sense Axis Force Zero Threshold:** The level on a sense axis to reach before the sense axis is forced to 0f
  2089. * **Sense Axis Press Threshold:** The amount of pressure required to be applied to a sense button before considering the sense button pressed.
  2090. * **Trigger Click Threshold:** The level on the trigger axis to reach before a click is registered.
  2091. * **Trigger Force Zero Threshold:** The level on the trigger axis to reach before the axis is forced to 0f.
  2092. * **Trigger Axis Zero On Untouch:** If this is checked then the trigger axis will be forced to 0f when the trigger button reports an untouch event.
  2093. * **Grip Click Threshold:** The level on the grip axis to reach before a click is registered.
  2094. * **Grip Force Zero Threshold:** The level on the grip axis to reach before the axis is forced to 0f.
  2095. * **Grip Axis Zero On Untouch:** If this is checked then the grip axis will be forced to 0f when the grip button reports an untouch event.
  2096. ### Class Variables
  2097. * `public enum ButtonAlias` - Button types
  2098. * `Undefined` - No button specified.
  2099. * `TriggerHairline` - The trigger is squeezed past the current hairline threshold.
  2100. * `TriggerTouch` - The trigger is squeezed a small amount.
  2101. * `TriggerPress` - The trigger is squeezed about half way in.
  2102. * `TriggerClick` - The trigger is squeezed all the way down.
  2103. * `GripHairline` - The grip is squeezed past the current hairline threshold.
  2104. * `GripTouch` - The grip button is touched.
  2105. * `GripPress` - The grip button is pressed.
  2106. * `GripClick` - The grip button is pressed all the way down.
  2107. * `TouchpadTouch` - The touchpad is touched (without pressing down to click).
  2108. * `TouchpadPress` - The touchpad is pressed (to the point of hearing a click).
  2109. * `TouchpadTwoTouch` - The touchpad two is touched (without pressing down to click).
  2110. * `TouchpadTwoPress` - The touchpad two is pressed (to the point of hearing a click).
  2111. * `ButtonOneTouch` - The button one is touched.
  2112. * `ButtonOnePress` - The button one is pressed.
  2113. * `ButtonTwoTouch` - The button two is touched.
  2114. * `ButtonTwoPress` - The button two is pressed.
  2115. * `StartMenuPress` - The start menu is pressed.
  2116. * `TouchpadSense` - The touchpad sense touch is active.
  2117. * `TriggerSense` - The trigger sense touch is active.
  2118. * `MiddleFingerSense` - The middle finger sense touch is active.
  2119. * `RingFingerSense` - The ring finger sense touch is active.
  2120. * `PinkyFingerSense` - The pinky finger sense touch is active.
  2121. * `GripSense` - The grip sense axis touch is active.
  2122. * `GripSensePress` - The grip sense axis is pressed.
  2123. * `public enum Vector2AxisAlias` - Vector2 Axis Types.
  2124. * `Undefined` - No axis specified.
  2125. * `Touchpad` - Touchpad on the controller.
  2126. * `TouchpadTwo` - Touchpad Two on the controller.
  2127. * `public enum AxisType` - Axis Types
  2128. * `Digital` - A digital axis with a binary result of 0f not pressed or 1f is pressed.
  2129. * `Axis` - An analog axis ranging from no squeeze at 0f to full squeeze at 1f.
  2130. * `SenseAxis` - A cap sens axis ranging from not near at 0f to touching at 1f.
  2131. * `public bool triggerPressed` - This will be true if the trigger is squeezed about half way in. Default: `false`
  2132. * `public bool triggerTouched` - This will be true if the trigger is squeezed a small amount. Default: `false`
  2133. * `public bool triggerHairlinePressed` - This will be true if the trigger is squeezed a small amount more from any previous squeeze on the trigger. Default: `false`
  2134. * `public bool triggerClicked` - This will be true if the trigger is squeezed all the way down. Default: `false`
  2135. * `public bool triggerAxisChanged` - This will be true if the trigger has been squeezed more or less. Default: `false`
  2136. * `public bool triggerSenseAxisChanged` - This will be true if the trigger sense is being touched more or less. Default: `false`
  2137. * `public bool gripPressed` - This will be true if the grip is squeezed about half way in. Default: `false`
  2138. * `public bool gripTouched` - This will be true if the grip is touched. Default: `false`
  2139. * `public bool gripHairlinePressed` - This will be true if the grip is squeezed a small amount more from any previous squeeze on the grip. Default: `false`
  2140. * `public bool gripClicked` - This will be true if the grip is squeezed all the way down. Default: `false`
  2141. * `public bool gripAxisChanged` - This will be true if the grip has been squeezed more or less. Default: `false`
  2142. * `public bool touchpadPressed` - This will be true if the touchpad is held down. Default: `false`
  2143. * `public bool touchpadTouched` - This will be true if the touchpad is being touched. Default: `false`
  2144. * `public bool touchpadAxisChanged` - This will be true if the touchpad position has changed. Default: `false`
  2145. * `public bool touchpadSenseAxisChanged` - This will be true if the touchpad sense is being touched more or less. Default: `false`
  2146. * `public bool touchpadTwoTouched` - This will be true if the touchpad two is being touched. Default: `false`
  2147. * `public bool touchpadTwoPressed` - This will be true if the touchpad two is held down. Default: `false`
  2148. * `public bool touchpadTwoAxisChanged` - This will be true if the touchpad two position has changed. Default: `false`
  2149. * `public bool buttonOnePressed` - This will be true if button one is held down. Default: `false`
  2150. * `public bool buttonOneTouched` - This will be true if button one is being touched. Default: `false`
  2151. * `public bool buttonTwoPressed` - This will be true if button two is held down. Default: `false`
  2152. * `public bool buttonTwoTouched` - This will be true if button two is being touched. Default: `false`
  2153. * `public bool startMenuPressed` - This will be true if start menu is held down. Default: `false`
  2154. * `public bool middleFingerSenseAxisChanged` - This will be true if the middle finger sense is being touched more or less. Default: `false`
  2155. * `public bool ringFingerSenseAxisChanged` - This will be true if the ring finger sense is being touched more or less. Default: `false`
  2156. * `public bool pinkyFingerSenseAxisChanged` - This will be true if the pinky finger sense is being touched more or less. Default: `false`
  2157. * `public bool gripSenseAxisChanged` - This will be true if the grip sense is being touched more or less. Default: `false`
  2158. * `public bool gripSensePressed` - This will be true if grip sense is held down. Default: `false`
  2159. * `public bool controllerVisible` - This will be true if the controller model alias renderers are visible. Default: `true`
  2160. ### Class Events
  2161. * `TriggerPressed` - Emitted when the trigger is squeezed about half way in.
  2162. * `TriggerReleased` - Emitted when the trigger is released under half way.
  2163. * `TriggerTouchStart` - Emitted when the trigger is squeezed a small amount.
  2164. * `TriggerTouchEnd` - Emitted when the trigger is no longer being squeezed at all.
  2165. * `TriggerHairlineStart` - Emitted when the trigger is squeezed past the current hairline threshold.
  2166. * `TriggerHairlineEnd` - Emitted when the trigger is released past the current hairline threshold.
  2167. * `TriggerClicked` - Emitted when the trigger is squeezed all the way down.
  2168. * `TriggerUnclicked` - Emitted when the trigger is no longer being held all the way down.
  2169. * `TriggerAxisChanged` - Emitted when the amount of squeeze on the trigger changes.
  2170. * `TriggerSenseAxisChanged` - Emitted when the amount of touch on the trigger sense changes.
  2171. * `GripPressed` - Emitted when the grip is squeezed about half way in.
  2172. * `GripReleased` - Emitted when the grip is released under half way.
  2173. * `GripTouchStart` - Emitted when the grip is squeezed a small amount.
  2174. * `GripTouchEnd` - Emitted when the grip is no longer being squeezed at all.
  2175. * `GripHairlineStart` - Emitted when the grip is squeezed past the current hairline threshold.
  2176. * `GripHairlineEnd` - Emitted when the grip is released past the current hairline threshold.
  2177. * `GripClicked` - Emitted when the grip is squeezed all the way down.
  2178. * `GripUnclicked` - Emitted when the grip is no longer being held all the way down.
  2179. * `GripAxisChanged` - Emitted when the amount of squeeze on the grip changes.
  2180. * `TouchpadPressed` - Emitted when the touchpad is pressed (to the point of hearing a click).
  2181. * `TouchpadReleased` - Emitted when the touchpad has been released after a pressed state.
  2182. * `TouchpadTouchStart` - Emitted when the touchpad is touched (without pressing down to click).
  2183. * `TouchpadTouchEnd` - Emitted when the touchpad is no longer being touched.
  2184. * `TouchpadAxisChanged` - Emitted when the touchpad is being touched in a different location.
  2185. * `TouchpadSenseAxisChanged` - Emitted when the amount of touch on the touchpad sense changes.
  2186. * `TouchpadTwoPressed` - Emitted when the touchpad two is pressed (to the point of hearing a click).
  2187. * `TouchpadTwoReleased` - Emitted when the touchpad two has been released after a pressed state.
  2188. * `TouchpadTwoTouchStart` - Emitted when the touchpad two is touched (without pressing down to click).
  2189. * `TouchpadTwoTouchEnd` - Emitted when the touchpad two is no longer being touched.
  2190. * `TouchpadTwoAxisChanged` - Emitted when the touchpad two is being touched in a different location.
  2191. * `ButtonOneTouchStart` - Emitted when button one is touched.
  2192. * `ButtonOneTouchEnd` - Emitted when button one is no longer being touched.
  2193. * `ButtonOnePressed` - Emitted when button one is pressed.
  2194. * `ButtonOneReleased` - Emitted when button one is released.
  2195. * `ButtonTwoTouchStart` - Emitted when button two is touched.
  2196. * `ButtonTwoTouchEnd` - Emitted when button two is no longer being touched.
  2197. * `ButtonTwoPressed` - Emitted when button two is pressed.
  2198. * `ButtonTwoReleased` - Emitted when button two is released.
  2199. * `StartMenuPressed` - Emitted when start menu is pressed.
  2200. * `StartMenuReleased` - Emitted when start menu is released.
  2201. * `MiddleFingerSenseAxisChanged` - Emitted when the amount of touch on the middle finger sense changes.
  2202. * `RingFingerSenseAxisChanged` - Emitted when the amount of touch on the ring finger sense changes.
  2203. * `PinkyFingerSenseAxisChanged` - Emitted when the amount of touch on the pinky finger sense changes.
  2204. * `GripSenseAxisChanged` - Emitted when the amount of touch on the grip sense changes.
  2205. * `GripSensePressed` - Emitted when grip sense is pressed.
  2206. * `GripSenseReleased` - Emitted when grip sense is released.
  2207. * `ControllerEnabled` - Emitted when the controller is enabled.
  2208. * `ControllerDisabled` - Emitted when the controller is disabled.
  2209. * `ControllerIndexChanged` - Emitted when the controller index changed.
  2210. * `ControllerModelAvailable` - Emitted when the controller model becomes available.
  2211. * `ControllerVisible` - Emitted when the controller is set to visible.
  2212. * `ControllerHidden` - Emitted when the controller is set to hidden.
  2213. ### Unity Events
  2214. Adding the `VRTK_ControllerEvents_UnityEvents` component to `VRTK_ControllerEvents` object allows access to `UnityEvents` that will react identically to the Class Events.
  2215. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  2216. ### Event Payload
  2217. * `VRTK_ControllerReference controllerReference` - The reference for the controller that initiated the event.
  2218. * `float buttonPressure` - The amount of pressure being applied to the button pressed. `0f` to `1f`.
  2219. * `Vector2 touchpadAxis` - The position the touchpad is touched at. `(0,0)` to `(1,1)`.
  2220. * `float touchpadAngle` - The rotational position the touchpad is being touched at, 0 being top, 180 being bottom and all other angles accordingly. `0f` to `360f`.
  2221. * `Vector2 touchpadTwoAxis` - The position the touchpad two is touched at. `(0,0)` to `(1,1)`.
  2222. * `float touchpadTwoAngle` - The rotational position the touchpad two is being touched at, 0 being top, 180 being bottom and all other angles accordingly. `0f` to `360f`.
  2223. ### Class Methods
  2224. #### SetControllerEvent/0
  2225. > `public virtual ControllerInteractionEventArgs SetControllerEvent()`
  2226. * Parameters
  2227. * _none_
  2228. * Returns
  2229. * `ControllerInteractionEventArgs` - The payload for a Controller Event.
  2230. The SetControllerEvent/0 method is used to set the Controller Event payload.
  2231. #### SetControllerEvent/3
  2232. > `public virtual ControllerInteractionEventArgs SetControllerEvent(ref bool buttonBool, bool value = false, float buttonPressure = 0f)`
  2233. * Parameters
  2234. * `ref bool buttonBool` - The state of the pressed button if required.
  2235. * `bool value` - The value to set the `buttonBool` reference to.
  2236. * `float buttonPressure` - The pressure of the button pressed if required.
  2237. * Returns
  2238. * `ControllerInteractionEventArgs` - The payload for a Controller Event.
  2239. The SetControllerEvent/3 method is used to set the Controller Event payload.
  2240. #### GetControllerType/0
  2241. > `public virtual SDK_BaseController.ControllerType GetControllerType()`
  2242. * Parameters
  2243. * _none_
  2244. * Returns
  2245. * `SDK_BaseController.ControllerType` - The type of controller that the Controller Events is attached to.
  2246. The GetControllerType method is a shortcut to retrieve the current controller type the Controller Events is attached to.
  2247. #### GetAxis/1
  2248. > `public virtual Vector2 GetAxis(Vector2AxisAlias vector2AxisType)`
  2249. * Parameters
  2250. * `Vector2AxisAlias vector2AxisType` - The Vector2AxisType to check the touch position of.
  2251. * Returns
  2252. * `Vector2` - A two dimensional vector containing the `x` and `y` position of where the given axis type is being touched. `(0,0)` to `(1,1)`.
  2253. The GetAxis method returns the coordinates of where the given axis type is being touched.
  2254. #### GetTouchpadAxis/0
  2255. > `public virtual Vector2 GetTouchpadAxis()`
  2256. * Parameters
  2257. * _none_
  2258. * Returns
  2259. * `Vector2` - A two dimensional vector containing the `x` and `y` position of where the touchpad is being touched. `(0,0)` to `(1,1)`.
  2260. The GetTouchpadAxis method returns the coordinates of where the touchpad is being touched and can be used for directional input via the touchpad. The `x` value is the horizontal touch plane and the `y` value is the vertical touch plane.
  2261. #### GetTouchpadTwoAxis/0
  2262. > `public virtual Vector2 GetTouchpadTwoAxis()`
  2263. * Parameters
  2264. * _none_
  2265. * Returns
  2266. * `Vector2` - A two dimensional vector containing the `x` and `y` position of where the touchpad two is being touched. `(0,0)` to `(1,1)`.
  2267. The GetTouchpadTwoAxis method returns the coordinates of where the touchpad two is being touched and can be used for directional input via the touchpad two. The `x` value is the horizontal touch plane and the `y` value is the vertical touch plane.
  2268. #### GetAxisAngle/1
  2269. > `public virtual float GetAxisAngle(Vector2AxisAlias vector2AxisType)`
  2270. * Parameters
  2271. * `Vector2AxisAlias vector2AxisType` - The Vector2AxisType to get the touch angle for.
  2272. * Returns
  2273. * `float` - A float representing the angle of where the given axis type is being touched. `0f` to `360f`.
  2274. The GetAxisAngle method returns the angle of where the given axis type is currently being touched with the top of the given axis type being `0` degrees and the bottom of the given axis type being `180` degrees.
  2275. #### GetTouchpadAxisAngle/0
  2276. > `public virtual float GetTouchpadAxisAngle()`
  2277. * Parameters
  2278. * _none_
  2279. * Returns
  2280. * `float` - A float representing the angle of where the touchpad is being touched. `0f` to `360f`.
  2281. The GetTouchpadAxisAngle method returns the angle of where the touchpad is currently being touched with the top of the touchpad being `0` degrees and the bottom of the touchpad being `180` degrees.
  2282. #### GetTouchpadTwoAxisAngle/0
  2283. > `public virtual float GetTouchpadTwoAxisAngle()`
  2284. * Parameters
  2285. * _none_
  2286. * Returns
  2287. * `float` - A float representing the angle of where the touchpad two is being touched. `0f` to `360f`.
  2288. The GetTouchpadTwoAxisAngle method returns the angle of where the touchpad two is currently being touched with the top of the touchpad two being `0` degrees and the bottom of the touchpad two being `180` degrees.
  2289. #### GetTriggerAxis/0
  2290. > `public virtual float GetTriggerAxis()`
  2291. * Parameters
  2292. * _none_
  2293. * Returns
  2294. * `float` - A float representing the amount of squeeze that is being applied to the trigger. `0f` to `1f`.
  2295. The GetTriggerAxis method returns a float that represents how much the trigger is being squeezed. This can be useful for using the trigger axis to perform high fidelity tasks or only activating the trigger press once it has exceeded a given press threshold.
  2296. #### GetGripAxis/0
  2297. > `public virtual float GetGripAxis()`
  2298. * Parameters
  2299. * _none_
  2300. * Returns
  2301. * `float` - A float representing the amount of squeeze that is being applied to the grip. `0f` to `1f`.
  2302. The GetGripAxis method returns a float that represents how much the grip is being squeezed. This can be useful for using the grip axis to perform high fidelity tasks or only activating the grip press once it has exceeded a given press threshold.
  2303. #### GetHairTriggerDelta/0
  2304. > `public virtual float GetHairTriggerDelta()`
  2305. * Parameters
  2306. * _none_
  2307. * Returns
  2308. * `float` - A float representing the difference in the trigger pressure from the hairline threshold start to current position.
  2309. The GetHairTriggerDelta method returns a float representing the difference in how much the trigger is being pressed in relation to the hairline threshold start.
  2310. #### GetHairGripDelta/0
  2311. > `public virtual float GetHairGripDelta()`
  2312. * Parameters
  2313. * _none_
  2314. * Returns
  2315. * `float` - A float representing the difference in the trigger pressure from the hairline threshold start to current position.
  2316. The GetHairTriggerDelta method returns a float representing the difference in how much the trigger is being pressed in relation to the hairline threshold start.
  2317. #### GetTouchpadSenseAxis/0
  2318. > `public virtual float GetTouchpadSenseAxis()`
  2319. * Parameters
  2320. * _none_
  2321. * Returns
  2322. * `float` - A float representing how much the touch sensor is being touched.
  2323. The GetTouchpadSenseAxis method returns a float representing how much of the touch sensor is being touched.
  2324. #### GetTriggerSenseAxis/0
  2325. > `public virtual float GetTriggerSenseAxis()`
  2326. * Parameters
  2327. * _none_
  2328. * Returns
  2329. * `float` - A float representing how much the touch sensor is being touched.
  2330. The GetTriggerSenseAxis method returns a float representing how much of the touch sensor is being touched.
  2331. #### GetMiddleFingerSenseAxis/0
  2332. > `public virtual float GetMiddleFingerSenseAxis()`
  2333. * Parameters
  2334. * _none_
  2335. * Returns
  2336. * `float` - A float representing how much the touch sensor is being touched.
  2337. The GetMiddleFingerSenseAxis method returns a float representing how much of the touch sensor is being touched.
  2338. #### GetRingFingerSenseAxis/0
  2339. > `public virtual float GetRingFingerSenseAxis()`
  2340. * Parameters
  2341. * _none_
  2342. * Returns
  2343. * `float` - A float representing how much the touch sensor is being touched.
  2344. The GetRingFingerSenseAxis method returns a float representing how much of the touch sensor is being touched.
  2345. #### GetPinkyFingerSenseAxis/0
  2346. > `public virtual float GetPinkyFingerSenseAxis()`
  2347. * Parameters
  2348. * _none_
  2349. * Returns
  2350. * `float` - A float representing how much the touch sensor is being touched.
  2351. The GetPinkyFingerSenseAxis method returns a float representing how much of the touch sensor is being touched.
  2352. #### GetGripSenseAxis/0
  2353. > `public virtual float GetGripSenseAxis()`
  2354. * Parameters
  2355. * _none_
  2356. * Returns
  2357. * `float` - A float representing how much the touch sensor is being touched.
  2358. The GetGripSenseAxis method returns a float representing how much of the touch sensor is being touched.
  2359. #### AnyButtonPressed/0
  2360. > `public virtual bool AnyButtonPressed()`
  2361. * Parameters
  2362. * _none_
  2363. * Returns
  2364. * `bool` - Returns `true` if any of the controller buttons are currently being pressed.
  2365. The AnyButtonPressed method returns true if any of the controller buttons are being pressed and this can be useful to determine if an action can be taken whilst the user is using the controller.
  2366. #### GetAxisState/2
  2367. > `public virtual bool GetAxisState(Vector2AxisAlias axis, SDK_BaseController.ButtonPressTypes pressType)`
  2368. * Parameters
  2369. * `Vector2AxisAlias axis` - The axis to check on.
  2370. * `SDK_BaseController.ButtonPressTypes pressType` - The button press type to check for.
  2371. * Returns
  2372. * `bool` - Returns `true` if the axis is being interacted with via the given press type.
  2373. The GetAxisState method takes a given Vector2Axis and returns a boolean whether that given axis is currently being touched or pressed.
  2374. #### IsButtonPressed/1
  2375. > `public virtual bool IsButtonPressed(ButtonAlias button)`
  2376. * Parameters
  2377. * `ButtonAlias button` - The button to check if it's being pressed.
  2378. * Returns
  2379. * `bool` - Returns `true` if the button is being pressed.
  2380. The IsButtonPressed method takes a given button alias and returns a boolean whether that given button is currently being pressed or not.
  2381. #### SubscribeToButtonAliasEvent/3
  2382. > `public virtual void SubscribeToButtonAliasEvent(ButtonAlias givenButton, bool startEvent, ControllerInteractionEventHandler callbackMethod)`
  2383. * Parameters
  2384. * `ButtonAlias givenButton` - The Button Alias to register the event on.
  2385. * `bool startEvent` - If this is `true` then the start event related to the button is used (e.g. `OnPress`). If this is `false` then the end event related to the button is used (e.g. `OnRelease`).
  2386. * `ControllerInteractionEventHandler callbackMethod` - The method to subscribe to the event.
  2387. * Returns
  2388. * _none_
  2389. The SubscribeToButtonAliasEvent method makes it easier to subscribe to a button event on either the start or end action. Upon the event firing, the given callback method is executed.
  2390. #### UnsubscribeToButtonAliasEvent/3
  2391. > `public virtual void UnsubscribeToButtonAliasEvent(ButtonAlias givenButton, bool startEvent, ControllerInteractionEventHandler callbackMethod)`
  2392. * Parameters
  2393. * `ButtonAlias givenButton` - The Button Alias to unregister the event on.
  2394. * `bool startEvent` - If this is `true` then the start event related to the button is used (e.g. `OnPress`). If this is `false` then the end event related to the button is used (e.g. `OnRelease`).
  2395. * `ControllerInteractionEventHandler callbackMethod` - The method to unsubscribe from the event.
  2396. * Returns
  2397. * _none_
  2398. The UnsubscribeToButtonAliasEvent method makes it easier to unsubscribe to from button event on either the start or end action.
  2399. #### SubscribeToAxisAliasEvent/3
  2400. > `public virtual void SubscribeToAxisAliasEvent(SDK_BaseController.ButtonTypes buttonType, AxisType axisType, ControllerInteractionEventHandler callbackMethod)`
  2401. * Parameters
  2402. * `SDK_BaseController.ButtonTypes buttonType` - The button to listen for axis changes on.
  2403. * `AxisType axisType` - The type of axis change to listen for.
  2404. * `ControllerInteractionEventHandler callbackMethod` - The method to subscribe to the event.
  2405. * Returns
  2406. * _none_
  2407. The SubscribeToAxisAliasEvent method makes it easier to subscribe to axis changes on a given button for a given axis type.
  2408. #### UnsubscribeToAxisAliasEvent/3
  2409. > `public virtual void UnsubscribeToAxisAliasEvent(SDK_BaseController.ButtonTypes buttonType, AxisType axisType, ControllerInteractionEventHandler callbackMethod)`
  2410. * Parameters
  2411. * `SDK_BaseController.ButtonTypes buttonType` - The button to unregister for axis changes on.
  2412. * `AxisType axisType` - The type of axis change to unregister on.
  2413. * `ControllerInteractionEventHandler callbackMethod` - The method to unsubscribe from the event.
  2414. * Returns
  2415. * _none_
  2416. The UnsubscribeToAxisAliasEvent method makes it easier to unsubscribe from axis changes on a given button for a given axis type.
  2417. ### Example
  2418. `VRTK/Examples/002_Controller_Events` shows how the events are utilised and listened to. The accompanying example script can be viewed in `VRTK/Examples/ExampleResources/Scripts/VRTK_ControllerEvents_ListenerExample.cs`.
  2419. ---
  2420. ## Interact Touch (VRTK_InteractTouch)
  2421. ### Overview
  2422. Determines if a GameObject can initiate a touch with an Interactable Object.
  2423. **Required Components:**
  2424. * `Rigidbody` - A Unity kinematic Rigidbody to determine when collisions happen between the Interact Touch GameObject and other valid colliders.
  2425. **Script Usage:**
  2426. * Place the `VRTK_InteractTouch` script on the controller script alias GameObject of the controller to track (e.g. Right Controller Script Alias).
  2427. ### Inspector Parameters
  2428. * **Custom Collider Container:** An optional GameObject that contains the compound colliders to represent the touching object. If this is empty then the collider will be auto generated at runtime to match the SDK default controller.
  2429. ### Class Events
  2430. * `ControllerStartTouchInteractableObject` - Emitted when the touch of a valid object has started.
  2431. * `ControllerTouchInteractableObject` - Emitted when a valid object is touched.
  2432. * `ControllerStartUntouchInteractableObject` - Emitted when the untouch of a valid object has started.
  2433. * `ControllerUntouchInteractableObject` - Emitted when a valid object is no longer being touched.
  2434. * `ControllerRigidbodyActivated` - Emitted when the controller rigidbody is activated.
  2435. * `ControllerRigidbodyDeactivated` - Emitted when the controller rigidbody is deactivated.
  2436. ### Unity Events
  2437. Adding the `VRTK_InteractTouch_UnityEvents` component to `VRTK_InteractTouch` object allows access to `UnityEvents` that will react identically to the Class Events.
  2438. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  2439. ### Event Payload
  2440. * `VRTK_ControllerReference controllerReference` - The reference to the controller doing the interaction.
  2441. * `GameObject target` - The GameObject of the Interactable Object that is being interacted with.
  2442. ### Class Methods
  2443. #### ForceTouch/1
  2444. > `public virtual void ForceTouch(GameObject obj)`
  2445. * Parameters
  2446. * `GameObject obj` - The GameObject to attempt to force touch.
  2447. * Returns
  2448. * _none_
  2449. The ForceTouch method will attempt to force the Interact Touch onto the given GameObject.
  2450. #### GetTouchedObject/0
  2451. > `public virtual GameObject GetTouchedObject()`
  2452. * Parameters
  2453. * _none_
  2454. * Returns
  2455. * `GameObject` - The GameObject of what is currently being touched by this Interact Touch.
  2456. The GetTouchedObject method returns the current GameObject being touched by the Interact Touch.
  2457. #### IsObjectInteractable/1
  2458. > `public virtual bool IsObjectInteractable(GameObject obj)`
  2459. * Parameters
  2460. * `GameObject obj` - The GameObject to check to see if it's a valid Interactable Object.
  2461. * Returns
  2462. * `bool` - Returns `true` if the given GameObjectis a valid Interactable Object.
  2463. The IsObjectInteractable method is used to check if a given GameObject is a valid Interactable Object.
  2464. #### ToggleControllerRigidBody/2
  2465. > `public virtual void ToggleControllerRigidBody(bool state, bool forceToggle = false)`
  2466. * Parameters
  2467. * `bool state` - The state of whether the rigidbody is on or off. `true` toggles the rigidbody on and `false` turns it off.
  2468. * `bool forceToggle` - Determines if the rigidbody has been forced into it's new state by another script. This can be used to override other non-force settings. Defaults to `false`
  2469. * Returns
  2470. * _none_
  2471. The ToggleControllerRigidBody method toggles the Interact Touch rigidbody's ability to detect collisions. If it is true then the controller rigidbody will collide with other collidable GameObjects.
  2472. #### IsRigidBodyActive/0
  2473. > `public virtual bool IsRigidBodyActive()`
  2474. * Parameters
  2475. * _none_
  2476. * Returns
  2477. * `bool` - Returns `true` if the rigidbody on the Interact Touch is currently active and able to affect other scene rigidbodies.
  2478. The IsRigidBodyActive method checks to see if the rigidbody on the Interact Touch is active and can affect other rigidbodies in the scene.
  2479. #### IsRigidBodyForcedActive/0
  2480. > `public virtual bool IsRigidBodyForcedActive()`
  2481. * Parameters
  2482. * _none_
  2483. * Returns
  2484. * `bool` - Returns `true` if the rigidbody is active and has been forced into the active state.
  2485. The IsRigidBodyForcedActive method checks to see if the rigidbody on the Interact Touch has been forced into the active state.
  2486. #### ForceStopTouching/0
  2487. > `public virtual void ForceStopTouching()`
  2488. * Parameters
  2489. * _none_
  2490. * Returns
  2491. * _none_
  2492. The ForceStopTouching method will stop the Interact Touch from touching an Interactable Object even if the Interact Touch is physically touching the Interactable Object.
  2493. #### ControllerColliders/0
  2494. > `public virtual Collider[] ControllerColliders()`
  2495. * Parameters
  2496. * _none_
  2497. * Returns
  2498. * `Collider[]` - An array of colliders that are associated with the controller.
  2499. The ControllerColliders method retrieves all of the associated colliders on the Interact Touch.
  2500. #### GetControllerType/0
  2501. > `public virtual SDK_BaseController.ControllerType GetControllerType()`
  2502. * Parameters
  2503. * _none_
  2504. * Returns
  2505. * `SDK_BaseController.ControllerType` - The type of controller that the Interact Touch is attached to.
  2506. The GetControllerType method is a shortcut to retrieve the current controller type the Interact Touch is attached to.
  2507. ### Example
  2508. `VRTK/Examples/005_Controller/BasicObjectGrabbing` demonstrates the highlighting of objects that have the `VRTK_InteractableObject` script added to them to show the ability to highlight interactable objects when they are touched by the controllers.
  2509. ---
  2510. ## Interact Near Touch (VRTK_InteractNearTouch)
  2511. ### Overview
  2512. Determines if a GameObject can initiate a near touch with an Interactable Object.
  2513. **Required Components:**
  2514. * `VRTK_InteractTouch` - The touch component to determine the actual interacting GameObject that will deal with the near touch interaction. This must be applied on the same GameObject as this script if one is not provided via the `Interact Touch` parameter.
  2515. **Script Usage:**
  2516. * Place the `VRTK_InteractNearTouch` script on either:
  2517. * The Interact Touch GameObject.
  2518. * Any other scene GameObject and provide a valid `VRTK_InteractTouch` component to the `Interact Touch` parameter of this script.
  2519. ### Inspector Parameters
  2520. * **Collider Radius:** The radius of the auto generated collider if a `Custom Collider Container` is not supplied.
  2521. * **Custom Collider Container:** An optional GameObject that contains the compound colliders to represent the near touching object. If this is empty then the collider will be auto generated at runtime.
  2522. * **Interact Touch:** The Interact Touch script to associate the near touches with. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  2523. ### Class Events
  2524. * `ControllerNearTouchInteractableObject` - Emitted when a valid object is near touched.
  2525. * `ControllerNearUntouchInteractableObject` - Emitted when a valid object is no longer being near touched.
  2526. ### Unity Events
  2527. Adding the `VRTK_InteractNearTouch_UnityEvents` component to `VRTK_InteractNearTouch` object allows access to `UnityEvents` that will react identically to the Class Events.
  2528. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  2529. ### Class Methods
  2530. #### GetNearTouchedObjects/0
  2531. > `public virtual List<GameObject> GetNearTouchedObjects()`
  2532. * Parameters
  2533. * _none_
  2534. * Returns
  2535. * `List<GameObject>` - A list of GameObjects that are being near touched.
  2536. The GetNearTouchedObjects method returns all of the GameObjects that are currently being near touched.
  2537. #### ForceNearTouch/1
  2538. > `public virtual void ForceNearTouch(GameObject obj)`
  2539. * Parameters
  2540. * `GameObject obj` - The GameObject to attempt to force near touch.
  2541. * Returns
  2542. * _none_
  2543. The ForceNearTouch method will attempt to force the controller to near touch the given GameObject.
  2544. #### ForceStopNearTouching/1
  2545. > `public virtual void ForceStopNearTouching(GameObject obj = null)`
  2546. * Parameters
  2547. * `GameObject obj` - An optional GameObject to only include in the force stop. If this is null then all near touched GameObjects will be force stopped.
  2548. * Returns
  2549. * _none_
  2550. The ForceStopNearTouching method will stop the Interact Touch GameObject from near touching an Interactable Object even if the Interact Touch GameObject is physically touching the Interactable Object still.
  2551. #### GetNearTouchedObjects/0
  2552. > `public virtual List<GameObject> GetNearTouchedObjects()`
  2553. * Parameters
  2554. * _none_
  2555. * Returns
  2556. * `List<GameObject>` - A list of GameObjects that are being near touched.
  2557. The GetNearTouchedObjects method returns all of the GameObjects that are currently being near touched.
  2558. ---
  2559. ## Interact Grab (VRTK_InteractGrab)
  2560. ### Overview
  2561. Determines if the Interact Touch can initiate a grab with the touched Interactable Object.
  2562. **Required Components:**
  2563. * `VRTK_InteractTouch` - The touch component to determine when a valid touch has taken place to denote a grab can occur. This must be applied on the same GameObject as this script if one is not provided via the `Interact Touch` parameter.
  2564. **Optional Components:**
  2565. * `VRTK_ControllerEvents` - The events component to listen for the button presses on. This must be applied on the same GameObject as this script if one is not provided via the `Controller Events` parameter.
  2566. **Script Usage:**
  2567. * Place the `VRTK_InteractGrab` script on either:
  2568. * The GameObject with the Interact Touch and Controller Events scripts.
  2569. * Any other scene GameObject and provide a valid `VRTK_ControllerEvents` component to the `Controller Events` parameter and a valid `VRTK_InteractTouch` component to the `Interact Touch` parameter of this script.
  2570. ### Inspector Parameters
  2571. * **Grab Button:** The button used to grab/release a touched Interactable Object.
  2572. * **Grab Precognition:** An amount of time between when the grab button is pressed to when the controller is touching an Interactable Object to grab it.
  2573. * **Throw Multiplier:** An amount to multiply the velocity of any Interactable Object being thrown.
  2574. * **Create Rigid Body When Not Touching:** If this is checked and the Interact Touch is not touching an Interactable Object when the grab button is pressed then a Rigidbody is added to the interacting object to allow it to push other Rigidbody objects around.
  2575. * **Controller Attach Point:** The rigidbody point on the controller model to snap the grabbed Interactable Object to. If blank it will be set to the SDK default.
  2576. * **Controller Events:** The Controller Events to listen for the events on. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  2577. * **Interact Touch:** The Interact Touch to listen for touches on. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  2578. ### Class Events
  2579. * `GrabButtonPressed` - Emitted when the grab button is pressed.
  2580. * `GrabButtonReleased` - Emitted when the grab button is released.
  2581. * `ControllerStartGrabInteractableObject` - Emitted when a grab of a valid object is started.
  2582. * `ControllerGrabInteractableObject` - Emitted when a valid object is grabbed.
  2583. * `ControllerStartUngrabInteractableObject` - Emitted when a ungrab of a valid object is started.
  2584. * `ControllerUngrabInteractableObject` - Emitted when a valid object is released from being grabbed.
  2585. ### Unity Events
  2586. Adding the `VRTK_InteractGrab_UnityEvents` component to `VRTK_InteractGrab` object allows access to `UnityEvents` that will react identically to the Class Events.
  2587. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  2588. ### Class Methods
  2589. #### IsGrabButtonPressed/0
  2590. > `public virtual bool IsGrabButtonPressed()`
  2591. * Parameters
  2592. * _none_
  2593. * Returns
  2594. * `bool` - Returns `true` if the grab alias button is being held down.
  2595. The IsGrabButtonPressed method determines whether the current grab alias button is being pressed down.
  2596. #### ForceRelease/1
  2597. > `public virtual void ForceRelease(bool applyGrabbingObjectVelocity = false)`
  2598. * Parameters
  2599. * `bool applyGrabbingObjectVelocity` - If this is true then upon releasing the Interactable Object any velocity on the Interact Touch GameObject will be applied to the Interactable Object to essentiall throw it. Defaults to `false`.
  2600. * Returns
  2601. * _none_
  2602. The ForceRelease method will force the Interact Grab to stop grabbing the currently grabbed Interactable Object.
  2603. #### AttemptGrab/0
  2604. > `public virtual void AttemptGrab()`
  2605. * Parameters
  2606. * _none_
  2607. * Returns
  2608. * _none_
  2609. The AttemptGrab method will attempt to grab the currently touched Interactable Object without needing to press the grab button on the controller.
  2610. #### GetGrabbedObject/0
  2611. > `public virtual GameObject GetGrabbedObject()`
  2612. * Parameters
  2613. * _none_
  2614. * Returns
  2615. * `GameObject` - The game object of what is currently being grabbed by this controller.
  2616. The GetGrabbedObject method returns the current Interactable Object being grabbed by the this Interact Grab.
  2617. #### ForceControllerAttachPoint/1
  2618. > `public virtual void ForceControllerAttachPoint(Rigidbody forcedAttachPoint)`
  2619. * Parameters
  2620. * `Rigidbody forcedAttachPoint` - The rigidbody to use as the controller attach point.
  2621. * Returns
  2622. * _none_
  2623. The ForceControllerAttachPoint method updates the rigidbody being used as the controller grab attach position.
  2624. ### Example
  2625. `VRTK/Examples/005_Controller/BasicObjectGrabbing` demonstrates the grabbing of interactable objects that have the `VRTK_InteractableObject` script attached to them. The objects can be picked up and thrown around.
  2626. `VRTK/Examples/013_Controller_UsingAndGrabbingMultipleObjects` demonstrates that each controller can grab and use objects independently and objects can also be toggled to their use state simultaneously.
  2627. `VRTK/Examples/014_Controller_SnappingObjectsOnGrab` demonstrates the different mechanisms for snapping a grabbed object to the controller.
  2628. ---
  2629. ## Interact Use (VRTK_InteractUse)
  2630. ### Overview
  2631. Determines if the Interact Touch can initiate a use interaction with the touched Interactable Object.
  2632. **Required Components:**
  2633. * `VRTK_InteractTouch` - The touch component to determine when a valid touch has taken place to denote a use interaction can occur. This must be applied on the same GameObject as this script if one is not provided via the `Interact Touch` parameter.
  2634. **Optional Components:**
  2635. * `VRTK_ControllerEvents` - The events component to listen for the button presses on. This must be applied on the same GameObject as this script if one is not provided via the `Controller Events` parameter.
  2636. * `VRTK_InteractGrab` - The grab component to determine when a valid grab has taken place. This must be applied on the same GameObject as this script if one is not provided via the `Interact Grab` parameter.
  2637. **Script Usage:**
  2638. * Place the `VRTK_InteractUse` script on either:
  2639. * The GameObject with the Interact Touch and Controller Events scripts.
  2640. * Any other scene GameObject and provide a valid `VRTK_ControllerEvents` component to the `Controller Events` parameter and a valid `VRTK_InteractTouch` component to the `Interact Touch` parameter of this script.
  2641. ### Inspector Parameters
  2642. * **Use Button:** The button used to use/unuse a touched Interactable Object.
  2643. * **Controller Events:** The Controller Events to listen for the events on. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  2644. * **Interact Touch:** The Interact Touch to listen for touches on. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  2645. * **Interact Grab:** The Interact Grab to listen for grab actions on. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  2646. ### Class Events
  2647. * `UseButtonPressed` - Emitted when the use toggle alias button is pressed.
  2648. * `UseButtonReleased` - Emitted when the use toggle alias button is released.
  2649. * `ControllerStartUseInteractableObject` - Emitted when a use of a valid object is started.
  2650. * `ControllerUseInteractableObject` - Emitted when a valid object starts being used.
  2651. * `ControllerStartUnuseInteractableObject` - Emitted when a unuse of a valid object is started.
  2652. * `ControllerUnuseInteractableObject` - Emitted when a valid object stops being used.
  2653. ### Unity Events
  2654. Adding the `VRTK_InteractUse_UnityEvents` component to `VRTK_InteractUse` object allows access to `UnityEvents` that will react identically to the Class Events.
  2655. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  2656. ### Class Methods
  2657. #### IsUseButtonPressed/0
  2658. > `public virtual bool IsUseButtonPressed()`
  2659. * Parameters
  2660. * _none_
  2661. * Returns
  2662. * `bool` - Returns `true` if the use alias button is being held down.
  2663. The IsUsebuttonPressed method determines whether the current use alias button is being pressed down.
  2664. #### GetUsingObject/0
  2665. > `public virtual GameObject GetUsingObject()`
  2666. * Parameters
  2667. * _none_
  2668. * Returns
  2669. * `GameObject` - The GameObject of what is currently being used by this Interact Use.
  2670. The GetUsingObject method returns the current GameObject being used by the Interact Use.
  2671. #### ForceStopUsing/0
  2672. > `public virtual void ForceStopUsing()`
  2673. * Parameters
  2674. * _none_
  2675. * Returns
  2676. * _none_
  2677. The ForceStopUsing method will force the Interact Use to stop using the currently touched Interactable Object and will also stop the Interactable Object's using action.
  2678. #### ForceResetUsing/0
  2679. > `public virtual void ForceResetUsing()`
  2680. * Parameters
  2681. * _none_
  2682. * Returns
  2683. * _none_
  2684. The ForceResetUsing will force the Interact Use to stop using the currently touched Interactable Object but the Interactable Object will continue with it's existing using action.
  2685. #### AttemptUse/0
  2686. > `public virtual void AttemptUse()`
  2687. * Parameters
  2688. * _none_
  2689. * Returns
  2690. * _none_
  2691. The AttemptUse method will attempt to use the currently touched Interactable Object without needing to press the use button on the controller.
  2692. ### Example
  2693. `VRTK/Examples/006_Controller_UsingADoor` simulates using a door object to open and close it. It also has a cube on the floor that can be grabbed to show how interactable objects can be usable or grabbable.
  2694. `VRTK/Examples/008_Controller_UsingAGrabbedObject` shows that objects can be grabbed with one button and used with another (e.g. firing a gun).
  2695. ---
  2696. ## Controller Tracked Collider (VRTK_ControllerTrackedCollider)
  2697. > extends VRTK_SDKControllerReady
  2698. ### Overview
  2699. Provides a controller collider collection that follows the controller rigidbody via the physics system.
  2700. **Required Components:**
  2701. * `VRTK_InteractTouch` - An Interact Touch script to determine which controller rigidbody to follow.
  2702. **Optional Components:**
  2703. * `VRTK_ControllerEvents` - The events component to listen for the button presses on. This must be applied in the same object hierarchy as the Interact Touch script if one is not provided via the `Controller Events` parameter.
  2704. **Script Usage:**
  2705. * Place the `VRTK_ControllerTrackedCollider` script on any active scene GameObject except the Script Alias objects.
  2706. * Assign the controller to track by applying an Interact Touch to the relevant Script Alias and then providing that reference to the `Interact Touch` parameter on this script.
  2707. ### Inspector Parameters
  2708. * **Interact Touch:** The Interact Touch script to relate the tracked collider to.
  2709. * **Max Resnap Distance:** The maximum distance the collider object can be from the controller before it automatically snaps back to the same position.
  2710. * **Activation Button:** The button to press to activate the colliders on the tracked collider set. If `Undefined` then it will always be active.
  2711. * **Controller Events:** An optional Controller Events to use for listening to the button events. If this is left blank then it will attempt to be retrieved from the same controller as the `Interact Touch` parameter.
  2712. ### Class Methods
  2713. #### ToggleColliders/1
  2714. > `public virtual void ToggleColliders(bool state)`
  2715. * Parameters
  2716. * `bool state` - If `true` then the tracked colliders will be able to affect other Rigidbodies.
  2717. * Returns
  2718. * _none_
  2719. The ToggleColliders method toggles the collision state of the tracked colliders.
  2720. #### TrackedColliders/0
  2721. > `public virtual Collider[] TrackedColliders()`
  2722. * Parameters
  2723. * _none_
  2724. * Returns
  2725. * `Collider[]` - A Collider array of the tracked colliders.
  2726. The TrackedColliders method returns an array of the tracked colliders.
  2727. ---
  2728. ## Controller Highlighter (VRTK_ControllerHighlighter)
  2729. ### Overview
  2730. Enables highlighting of controller elements.
  2731. **Optional Components:**
  2732. * `VRTK_BaseHighlighter` - The highlighter to use when highligting the controller. If one is not already injected in the `Controller Highlighter` parameter then the component on the same GameObject will be used.
  2733. **Script Usage:**
  2734. * Place the `VRTK_ControllerHighlighter` script on either:
  2735. * The controller script alias GameObject of the controller to affect (e.g. Right Controller Script Alias).
  2736. * Any other scene GameObject and provide the controller script alias GameObject to the `Controller Alias` parameter of this script.
  2737. * The Model Element Paths will be auto populated at runtime based on the SDK Setup Model Alias being used (except if a custom Model Alias for the SDK Setup is provided).
  2738. * The Highlighter used by the Controller Highlighter will be selected in the following order:
  2739. * The provided Base Highlighter in the `Controller Highlighter` parameter.
  2740. * If the above is not provided, then the first active Base Highlighter found on the actual controller GameObject will be used.
  2741. * If the above is not found, then a Material Color Swap Highlighter will be created on the actual controller GameObject at runtime.
  2742. ### Inspector Parameters
  2743. * **Transition Duration:** The amount of time to take to transition to the set highlight colour.
  2744. * **Highlight Controller:** The colour to set the entire controller highlight colour to.
  2745. * **Highlight Body:** The colour to set the body highlight colour to.
  2746. * **Highlight Trigger:** The colour to set the trigger highlight colour to.
  2747. * **Highlight Grip:** The colour to set the grip highlight colour to.
  2748. * **Highlight Touchpad:** The colour to set the touchpad highlight colour to.
  2749. * **Highlight Touchpad Two:** The colour to set the touchpad two highlight colour to.
  2750. * **Highlight Button One:** The colour to set the button one highlight colour to.
  2751. * **Highlight Button Two:** The colour to set the button two highlight colour to.
  2752. * **Highlight System Menu:** The colour to set the system menu highlight colour to.
  2753. * **Highlight Start Menu:** The colour to set the start menu highlight colour to.
  2754. * **Model Element Paths:** A collection of strings that determine the path to the controller model sub elements for identifying the model parts at runtime. If the paths are left empty they will default to the model element paths of the selected SDK Bridge.
  2755. * **Element Highlighter Overrides:** A collection of highlighter overrides for each controller model sub element. If no highlighter override is given then highlighter on the Controller game object is used.
  2756. * **Controller Alias:** An optional GameObject to specify which controller to apply the script methods to. If this is left blank then this script is required to be placed on a controller script alias GameObject and it will use the Actual Controller GameObject linked to the controller script alias.
  2757. * **Model Container:** An optional GameObject to specifiy where the controller models are. If this is left blank then the controller Model Alias object will be used.
  2758. * **Controller Highlighter:** An optional Highlighter to use when highlighting the controller element. If this is left blank, then the first active highlighter on the same GameObject will be used, if one isn't found then a Material Color Swap Highlighter will be created at runtime.
  2759. ### Class Methods
  2760. #### ConfigureControllerPaths/0
  2761. > `public virtual void ConfigureControllerPaths()`
  2762. * Parameters
  2763. * _none_
  2764. * Returns
  2765. * _none_
  2766. The ConfigureControllerPaths method is used to set up the model element paths.
  2767. #### PopulateHighlighters/0
  2768. > `public virtual void PopulateHighlighters()`
  2769. * Parameters
  2770. * _none_
  2771. * Returns
  2772. * _none_
  2773. The PopulateHighlighters method sets up the highlighters on the controller model.
  2774. #### HighlightController/2
  2775. > `public virtual void HighlightController(Color color, float fadeDuration = 0f)`
  2776. * Parameters
  2777. * `Color color` - The Color to highlight the controller to.
  2778. * `float fadeDuration` - The duration in seconds to fade from the initial color to the target color.
  2779. * Returns
  2780. * _none_
  2781. The HighlightController method attempts to highlight all sub models of the controller.
  2782. #### UnhighlightController/0
  2783. > `public virtual void UnhighlightController()`
  2784. * Parameters
  2785. * _none_
  2786. * Returns
  2787. * _none_
  2788. The UnhighlightController method attempts to remove the highlight from all sub models of the controller.
  2789. #### HighlightElement/3
  2790. > `public virtual void HighlightElement(SDK_BaseController.ControllerElements elementType, Color color, float fadeDuration = 0f)`
  2791. * Parameters
  2792. * `SDK_BaseController.ControllerElements elementType` - The element type on the controller.
  2793. * `Color color` - The Color to highlight the controller element to.
  2794. * `float fadeDuration` - The duration in seconds to fade from the initial color to the target color.
  2795. * Returns
  2796. * _none_
  2797. The HighlightElement method attempts to highlight a specific controller element.
  2798. #### UnhighlightElement/1
  2799. > `public virtual void UnhighlightElement(SDK_BaseController.ControllerElements elementType)`
  2800. * Parameters
  2801. * `SDK_BaseController.ControllerElements elementType` - The element type on the controller.
  2802. * Returns
  2803. * _none_
  2804. The UnhighlightElement method attempts to remove the highlight from the specific controller element.
  2805. ### Example
  2806. `VRTK/Examples/035_Controller_OpacityAndHighlighting` demonstrates the ability to change the opacity of a controller model and to highlight specific elements of a controller such as the buttons or even the entire controller model.
  2807. ---
  2808. ## Object Auto Grab (VRTK_ObjectAutoGrab)
  2809. ### Overview
  2810. Attempt to automatically grab a specified Interactable Object.
  2811. **Required Components:**
  2812. * `VRTK_InteractTouch` - The touch component to determine when a valid touch has taken place to denote a use interaction can occur. This must be applied on the same GameObject as this script if one is not provided via the `Interact Touch` parameter.
  2813. * `VRTK_InteractGrab` - The grab component to determine when a valid grab has taken place. This must be applied on the same GameObject as this script if one is not provided via the `Interact Grab` parameter.
  2814. **Script Usage:**
  2815. * Place the `VRTK_ObjectAutoGrab` script on either:
  2816. * The GameObject that contains the Interact Touch and Interact Grab scripts.
  2817. * Any other scene GameObject and provide a valid `VRTK_InteractTouch` component to the `Interact Touch` parameter and a valid `VRTK_InteractGrab` component to the `Interact Grab` parameter of this script.
  2818. * Assign the Interactable Object to auto grab to the `Object To Grab` parameter on this script.
  2819. * If this Interactable Object is a prefab then the `Object Is Prefab` parameter on this script must be checked.
  2820. ### Inspector Parameters
  2821. * **Object To Grab:** The Interactable Object that will be grabbed by the Interact Grab.
  2822. * **Object Is Prefab:** If the `Object To Grab` is a prefab then this needs to be checked, if the `Object To Grab` already exists in the scene then this needs to be unchecked.
  2823. * **Clone Grabbed Object:** If this is checked then the `Object To Grab` will be cloned into a new Interactable Object and grabbed by the Interact Grab leaving the existing Interactable Object in the scene. This is required if the same Interactable Object is to be grabbed to multiple instances of Interact Grab. It is also required to clone a grabbed Interactable Object if it is a prefab as it needs to exist within the scene to be grabbed.
  2824. * **Always Clone On Enable:** If `Clone Grabbed Object` is checked and this is checked, then whenever this script is disabled and re-enabled, it will always create a new clone of the Interactable Object to grab. If this is unchecked then the original cloned Interactable Object will attempt to be grabbed again. If the original cloned object no longer exists then a new clone will be created.
  2825. * **Attempt Secondary Grab:** If this is checked then the `Object To Grab` will attempt to be secondary grabbed as well as primary grabbed.
  2826. * **Interact Touch:** The Interact Touch to listen for touches on. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  2827. * **Interact Grab:** The Interact Grab to listen for grab actions on. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  2828. * **Secondary Interact Touch:** The secondary controller Interact Touch to listen for touches on. If this field is left blank then it will be looked up on the opposite controller script alias at runtime.
  2829. * **Secondary Interact Grab:** The secondary controller Interact Grab to listen for grab actions on. If this field is left blank then it will be looked up on the opposite controller script alias at runtime.
  2830. ### Class Events
  2831. * `ObjectAutoGrabCompleted` - Emitted when the object auto grab has completed successfully.
  2832. ### Unity Events
  2833. Adding the `VRTK_ObjectAutoGrab_UnityEvents` component to `VRTK_ObjectAutoGrab` object allows access to `UnityEvents` that will react identically to the Class Events.
  2834. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  2835. ### Class Methods
  2836. #### ClearPreviousClone/0
  2837. > `public virtual void ClearPreviousClone()`
  2838. * Parameters
  2839. * _none_
  2840. * Returns
  2841. * _none_
  2842. The ClearPreviousClone method resets the previous cloned Interactable Object to null to ensure when the script is re-enabled that a new cloned Interactable Object is created, rather than the original clone being grabbed again.
  2843. ### Example
  2844. `VRTK/Examples/026_Controller_ForceHoldObject` shows how to automatically grab a sword to each controller and also prevents the swords from being dropped so they are permanently attached to the user's controllers.
  2845. ---
  2846. # Interactables (VRTK/Source/Scripts/Interactions/Interactables)
  2847. A collection of scripts that provide the ability denote objects as being interactable and providing functionality when an object is interected with.
  2848. * [Interactable Object](#interactable-object-vrtk_interactableobject)
  2849. * [Interactable Listener](#interactable-listener-vrtk_interactablelistener)
  2850. * [Interact Haptics](#interact-haptics-vrtk_interacthaptics)
  2851. * [Interact Object Appearance](#interact-object-appearance-vrtk_interactobjectappearance)
  2852. * [Interact Object Highlighter](#interact-object-highlighter-vrtk_interactobjecthighlighter)
  2853. * [Object Touch Auto Interact](#object-touch-auto-interact-vrtk_objecttouchautointeract)
  2854. * [Ignore Interact Touch Colliders](#ignore-interact-touch-colliders-vrtk_ignoreinteracttouchcolliders)
  2855. ---
  2856. ## Interactable Object (VRTK_InteractableObject)
  2857. ### Overview
  2858. Determines if the GameObject can be interacted with.
  2859. **Required Components:**
  2860. * `Collider` - A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects.
  2861. **Optional Components:**
  2862. * `Rigidbody` - A Unity Rigidbody to allow the GameObject to be affected by the Unity Physics System (not required for Climbable Grab Attach Types).
  2863. * `VRTK_BaseGrabAttach` - A Grab Attach mechanic for determining how the Interactable Object is grabbed by the primary interacting object.
  2864. * `VRTK_BaseGrabAction` - A Grab Action mechanic for determining how to manipulate the Interactable Object when grabbed by the secondary interacting object.
  2865. **Script Usage:**
  2866. * Place the `VRTK_InteractableObject` script onto the GameObject that is to be interactable.
  2867. * Alternatively, select the GameObject and use the `Window -> VRTK -> Setup Interactable Object` panel to set up quickly.
  2868. * The optional Highlighter used by the Interactable Object will be selected in the following order:
  2869. * The provided Base Highlighter in the `Object Highlighter` parameter.
  2870. * If the above is not provided, then the first active Base Highlighter found on the Interactable Object GameObject will be used.
  2871. * If the above is not found, then a Material Color Swap Highlighter will be created on the Interactable Object GameObject at runtime.
  2872. **Script Dependencies:**
  2873. * Interactions
  2874. * To near touch an Interactable Object the Interact NearTouch script is required on a controller Script Alias GameObject.
  2875. * To touch an Interactable Object the Interact NearTouch script is required on a controller Script Alias GameObject.
  2876. * To grab an Interactable Object the Interact Grab script is required on a controller Script Alias GameObject.
  2877. * To use an Interactable Object the Interact Use script is required on a controller Script Alias GameObject.
  2878. * Highlighting
  2879. * To highlight an Interactable Object on a given interaction then a valid Interact Object Highlighter script must be associated with the Interactable Object.
  2880. * Appearance
  2881. * To affect the appearance of an Interactable Object then a valid Interact Object Appearance script must be associated with the Interactable Object.
  2882. ### Inspector Parameters
  2883. * **Disable When Idle:** If this is checked then the Interactable Object component will be disabled when the Interactable Object is not being interacted with.
  2884. * **Allowed Near Touch Controllers:** Determines which controller can initiate a near touch action.
  2885. * **Allowed Touch Controllers:** Determines which controller can initiate a touch action.
  2886. * **Ignored Colliders:** An array of colliders on the GameObject to ignore when being touched.
  2887. * **Is Grabbable:** Determines if the Interactable Object can be grabbed.
  2888. * **Hold Button To Grab:** If this is checked then the grab button on the controller needs to be continually held down to keep grabbing. If this is unchecked the grab button toggles the grab action with one button press to grab and another to release.
  2889. * **Stay Grabbed On Teleport:** If this is checked then the Interactable Object will stay grabbed to the controller when a teleport occurs. If it is unchecked then the Interactable Object will be released when a teleport occurs.
  2890. * **Valid Drop:** Determines in what situation the Interactable Object can be dropped by the controller grab button.
  2891. * **Grab Override Button:** Setting to a button will ensure the override button is used to grab this specific Interactable Object. Setting to `Undefined` will mean the `Grab Button` on the Interact Grab script will grab the object.
  2892. * **Allowed Grab Controllers:** Determines which controller can initiate a grab action.
  2893. * **Grab Attach Mechanic Script:** This determines how the grabbed Interactable Object will be attached to the controller when it is grabbed. If one isn't provided then the first Grab Attach script on the GameObject will be used, if one is not found and the object is grabbable then a Fixed Joint Grab Attach script will be created at runtime.
  2894. * **Secondary Grab Action Script:** The script to utilise when processing the secondary controller action on a secondary grab attempt. If one isn't provided then the first Secondary Controller Grab Action script on the GameObject will be used, if one is not found then no action will be taken on secondary grab.
  2895. * **Is Usable:** Determines if the Interactable Object can be used.
  2896. * **Hold Button To Use:** If this is checked then the use button on the controller needs to be continually held down to keep using. If this is unchecked the the use button toggles the use action with one button press to start using and another to stop using.
  2897. * **Use Only If Grabbed:** If this is checked the Interactable Object can be used only if it is currently being grabbed.
  2898. * **Pointer Activates Use Action:** If this is checked then when a Pointer collides with the Interactable Object it will activate it's use action. If the the `Hold Button To Use` parameter is unchecked then whilst the Pointer is collising with the Interactable Object it will run the `Using` method. If `Hold Button To Use` is unchecked then the `Using` method will be run when the Pointer is deactivated. The Pointer will not emit the `Destination Set` event if it is affecting an Interactable Object with this setting checked as this prevents unwanted teleporting from happening when using an Interactable Object with a pointer.
  2899. * **Use Override Button:** Setting to a button will ensure the override button is used to use this specific Interactable Object. Setting to `Undefined` will mean the `Use Button` on the Interact Use script will use the object.
  2900. * **Allowed Use Controllers:** Determines which controller can initiate a use action.
  2901. ### Class Variables
  2902. * `public enum InteractionType` - The interaction type.
  2903. * `None` - No interaction is affecting the object.
  2904. * `NearTouch` - The near touch interaction is affecting the object.
  2905. * `NearUntouch` - The near untouch interaction stopped affecting the object
  2906. * `Touch` - The touch interaction is affecting the object.
  2907. * `Untouch` - The untouch interaction stopped affecting the object
  2908. * `Grab` - The grab interaction is affecting the object.
  2909. * `Ungrab` - The ungrab interaction stopped affecting the object
  2910. * `Use` - The use interaction is affecting the object.
  2911. * `Unuse` - The unuse interaction stopped affecting the object
  2912. * `public enum AllowedController` - Allowed controller type.
  2913. * `Both` - Both controllers are allowed to interact.
  2914. * `LeftOnly` - Only the left controller is allowed to interact.
  2915. * `RightOnly` - Only the right controller is allowed to interact.
  2916. * `public enum ValidDropTypes` - The types of valid situations that the object can be released from grab.
  2917. * `NoDrop` - The object cannot be dropped via the controller.
  2918. * `DropAnywhere` - The object can be dropped anywhere in the scene via the controller.
  2919. * `DropValidSnapDropZone` - The object can only be dropped when it is hovering over a valid snap drop zone.
  2920. * `public int usingState` - The current using state of the Interactable Object. `0` not being used, `1` being used. Default: `0`
  2921. * `public bool isKinematic` - isKinematic is a pass through to the `isKinematic` getter/setter on the Interactable Object's Rigidbody component.
  2922. ### Class Events
  2923. * `InteractableObjectEnabled` - Emitted when the Interactable Object script is enabled;
  2924. * `InteractableObjectDisabled` - Emitted when the Interactable Object script is disabled;
  2925. * `InteractableObjectNearTouched` - Emitted when another interacting object near touches the current Interactable Object.
  2926. * `InteractableObjectNearUntouched` - Emitted when the other interacting object stops near touching the current Interactable Object.
  2927. * `InteractableObjectTouched` - Emitted when another interacting object touches the current Interactable Object.
  2928. * `InteractableObjectUntouched` - Emitted when the other interacting object stops touching the current Interactable Object.
  2929. * `InteractableObjectGrabbed` - Emitted when another interacting object grabs the current Interactable Object.
  2930. * `InteractableObjectUngrabbed` - Emitted when the other interacting object stops grabbing the current Interactable Object.
  2931. * `InteractableObjectUsed` - Emitted when another interacting object uses the current Interactable Object.
  2932. * `InteractableObjectUnused` - Emitted when the other interacting object stops using the current Interactable Object.
  2933. * `InteractableObjectEnteredSnapDropZone` - Emitted when the Interactable Object enters a Snap Drop Zone.
  2934. * `InteractableObjectExitedSnapDropZone` - Emitted when the Interactable Object exists a Snap Drop Zone.
  2935. * `InteractableObjectSnappedToDropZone` - Emitted when the Interactable Object gets snapped to a Snap Drop Zone.
  2936. * `InteractableObjectUnsnappedFromDropZone` - Emitted when the Interactable Object gets unsnapped from a Snap Drop Zone.
  2937. ### Unity Events
  2938. Adding the `VRTK_InteractableObject_UnityEvents` component to `VRTK_InteractableObject` object allows access to `UnityEvents` that will react identically to the Class Events.
  2939. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  2940. ### Event Payload
  2941. * `GameObject interactingObject` - The GameObject that is initiating the interaction (e.g. a controller).
  2942. ### Class Methods
  2943. #### IsNearTouched/0
  2944. > `public virtual bool IsNearTouched()`
  2945. * Parameters
  2946. * _none_
  2947. * Returns
  2948. * `bool` - Returns `true` if the Interactable Object is currently being near touched.
  2949. The IsNearTouched method is used to determine if the Interactable Object is currently being near touched.
  2950. #### IsTouched/0
  2951. > `public virtual bool IsTouched()`
  2952. * Parameters
  2953. * _none_
  2954. * Returns
  2955. * `bool` - Returns `true` if the Interactable Object is currently being touched.
  2956. The IsTouched method is used to determine if the Interactable Object is currently being touched.
  2957. #### IsGrabbed/1
  2958. > `public virtual bool IsGrabbed(GameObject grabbedBy = null)`
  2959. * Parameters
  2960. * `GameObject grabbedBy` - An optional GameObject to check if the Interactable Object is grabbed by that specific GameObject. Defaults to `null`
  2961. * Returns
  2962. * `bool` - Returns `true` if the Interactable Object is currently being grabbed.
  2963. The IsGrabbed method is used to determine if the Interactable Object is currently being grabbed.
  2964. #### IsUsing/1
  2965. > `public virtual bool IsUsing(GameObject usedBy = null)`
  2966. * Parameters
  2967. * `GameObject usedBy` - An optional GameObject to check if the Interactable Object is used by that specific GameObject. Defaults to `null`
  2968. * Returns
  2969. * `bool` - Returns `true` if the Interactable Object is currently being used.
  2970. The IsUsing method is used to determine if the Interactable Object is currently being used.
  2971. #### StartNearTouching/1
  2972. > `public virtual void StartNearTouching(VRTK_InteractNearTouch currentNearTouchingObject = null)`
  2973. * Parameters
  2974. * `VRTK_InteractNearTouch currentNearTouchingObject` - The interacting object that is currently nearly touching this Interactable Object.
  2975. * Returns
  2976. * _none_
  2977. The StartNearTouching method is called automatically when the Interactable Object is initially nearly touched.
  2978. #### StopNearTouching/1
  2979. > `public virtual void StopNearTouching(VRTK_InteractNearTouch previousNearTouchingObject = null)`
  2980. * Parameters
  2981. * `VRTK_InteractNearTouch previousNearTouchingObject` - The interacting object that was previously nearly touching this Interactable Object.
  2982. * Returns
  2983. * _none_
  2984. The StopNearTouching method is called automatically when the Interactable Object has stopped being nearly touched.
  2985. #### StartTouching/1
  2986. > `public virtual void StartTouching(VRTK_InteractTouch currentTouchingObject = null)`
  2987. * Parameters
  2988. * `VRTK_InteractTouch currentTouchingObject` - The interacting object that is currently touching this Interactable Object.
  2989. * Returns
  2990. * _none_
  2991. The StartTouching method is called automatically when the Interactable Object is touched initially.
  2992. #### StopTouching/1
  2993. > `public virtual void StopTouching(VRTK_InteractTouch previousTouchingObject = null)`
  2994. * Parameters
  2995. * `VRTK_InteractTouch previousTouchingObject` - The interacting object that was previously touching this Interactable Object.
  2996. * Returns
  2997. * _none_
  2998. The StopTouching method is called automatically when the Interactable Object has stopped being touched.
  2999. #### Grabbed/1
  3000. > `public virtual void Grabbed(VRTK_InteractGrab currentGrabbingObject = null)`
  3001. * Parameters
  3002. * `VRTK_InteractGrab currentGrabbingObject` - The interacting object that is currently grabbing this Interactable Object.
  3003. * Returns
  3004. * _none_
  3005. The Grabbed method is called automatically when the Interactable Object is grabbed initially.
  3006. #### Ungrabbed/1
  3007. > `public virtual void Ungrabbed(VRTK_InteractGrab previousGrabbingObject = null)`
  3008. * Parameters
  3009. * `VRTK_InteractGrab previousGrabbingObject` - The interacting object that was previously grabbing this Interactable Object.
  3010. * Returns
  3011. * _none_
  3012. The Ungrabbed method is called automatically when the Interactable Object has stopped being grabbed.
  3013. #### StartUsing/1
  3014. > `public virtual void StartUsing(VRTK_InteractUse currentUsingObject = null)`
  3015. * Parameters
  3016. * `VRTK_InteractUse currentUsingObject` - The interacting object that is currently using this Interactable Object.
  3017. * Returns
  3018. * _none_
  3019. The StartUsing method is called automatically when the Interactable Object is used initially.
  3020. #### StopUsing/2
  3021. > `public virtual void StopUsing(VRTK_InteractUse previousUsingObject = null, bool resetUsingObjectState = true)`
  3022. * Parameters
  3023. * `VRTK_InteractUse previousUsingObject` - The interacting object that was previously using this Interactable Object.
  3024. * `bool resetUsingObjectState` - Resets the using object state to reset it's using action.
  3025. * Returns
  3026. * _none_
  3027. The StopUsing method is called automatically when the Interactable Object has stopped being used.
  3028. #### PauseCollisions/1
  3029. > `public virtual void PauseCollisions(float delay)`
  3030. * Parameters
  3031. * `float delay` - The time in seconds to pause the collisions for.
  3032. * Returns
  3033. * _none_
  3034. The PauseCollisions method temporarily pauses all collisions on the Interactable Object at grab time by removing the Interactable Object's Rigidbody's ability to detect collisions.
  3035. #### ZeroVelocity/0
  3036. > `public virtual void ZeroVelocity()`
  3037. * Parameters
  3038. * _none_
  3039. * Returns
  3040. * _none_
  3041. The ZeroVelocity method resets the velocity and angular velocity to zero on the Rigidbody attached to the Interactable Object.
  3042. #### SaveCurrentState/0
  3043. > `public virtual void SaveCurrentState()`
  3044. * Parameters
  3045. * _none_
  3046. * Returns
  3047. * _none_
  3048. The SaveCurrentState method stores the existing Interactable Object parent and the Rigidbody kinematic setting.
  3049. #### GetPreviousState/3
  3050. > `public virtual void GetPreviousState(out Transform previousParent, out bool previousKinematic, out bool previousGrabbable)`
  3051. * Parameters
  3052. * `out Transform previousParent` - Out param for the previous parent
  3053. * `out bool previousKinematic` - Out param for the previous Kinematic state
  3054. * `out bool previousGrabbable` - Out param for the previous Grabbable State
  3055. * Returns
  3056. * _none_
  3057. Returns the previous state of the Interactable Object
  3058. #### OverridePreviousState/3
  3059. > `public virtual void OverridePreviousState(Transform previousParent, bool previousKinematic, bool previousGrabbable)`
  3060. * Parameters
  3061. * `Transform previousParent` - value of the previous parent
  3062. * `bool previousKinematic` - value of the previous Kinematic state
  3063. * `bool previousGrabbable` - value of the previous Grabbable State
  3064. * Returns
  3065. * _none_
  3066. Overrides the previous state of the Interactable Object
  3067. #### GetNearTouchingObjects/0
  3068. > `public virtual List<GameObject> GetNearTouchingObjects()`
  3069. * Parameters
  3070. * _none_
  3071. * Returns
  3072. * `List<GameObject>` - A list of GameObject of that are currently nearly touching the current Interactable Object.
  3073. The GetNearTouchingObjects method is used to return the collecetion of valid GameObjects that are currently nearly touching this Interactable Object.
  3074. #### GetTouchingObjects/0
  3075. > `public virtual List<GameObject> GetTouchingObjects()`
  3076. * Parameters
  3077. * _none_
  3078. * Returns
  3079. * `List<GameObject>` - A list of GameObject of that are currently touching the current Interactable Object.
  3080. The GetTouchingObjects method is used to return the collecetion of valid GameObjects that are currently touching this Interactable Object.
  3081. #### GetGrabbingObject/0
  3082. > `public virtual GameObject GetGrabbingObject()`
  3083. * Parameters
  3084. * _none_
  3085. * Returns
  3086. * `GameObject` - The GameObject of what is grabbing the current Interactable Object.
  3087. The GetGrabbingObject method is used to return the GameObject that is currently grabbing this Interactable Object.
  3088. #### GetSecondaryGrabbingObject/0
  3089. > `public virtual GameObject GetSecondaryGrabbingObject()`
  3090. * Parameters
  3091. * _none_
  3092. * Returns
  3093. * `GameObject` - The GameObject of the secondary influencing object of the current grabbed Interactable Object.
  3094. The GetSecondaryGrabbingObject method is used to return the GameObject that is currently being used to influence this Interactable Object whilst it is being grabbed by a secondary influencing.
  3095. #### GetUsingObject/0
  3096. > `public virtual GameObject GetUsingObject()`
  3097. * Parameters
  3098. * _none_
  3099. * Returns
  3100. * `GameObject` - The GameObject of what is using the current Interactable Object.
  3101. The GetUsingObject method is used to return the GameObject that is currently using this Interactable Object.
  3102. #### GetUsingScript/0
  3103. > `public virtual VRTK_InteractUse GetUsingScript()`
  3104. * Parameters
  3105. * _none_
  3106. * Returns
  3107. * `VRTK_InteractUse` - The Interact Use script of the interacting object that is using the current Interactable Object.
  3108. The GetUsingScript method is used to return the Interact Use component that is currently using this Interactable Object.
  3109. #### IsValidInteractableController/2
  3110. > `public virtual bool IsValidInteractableController(GameObject actualController, AllowedController controllerCheck)`
  3111. * Parameters
  3112. * `GameObject actualController` - The GameObject of the controller that is being checked.
  3113. * `AllowedController controllerCheck` - The value of which controller is allowed to interact with this object.
  3114. * Returns
  3115. * `bool` - Returns `true` if the interacting controller is allowed to grab the Interactable Object.
  3116. The IsValidInteractableController method is used to check to see if a controller is allowed to perform an interaction with this Interactable Object as sometimes controllers are prohibited from grabbing or using an Interactable Object depedning on the use case.
  3117. #### ForceStopInteracting/0
  3118. > `public virtual void ForceStopInteracting()`
  3119. * Parameters
  3120. * _none_
  3121. * Returns
  3122. * _none_
  3123. The ForceStopInteracting method forces the Interactable Object to no longer be interacted with and will cause an interacting object to drop the Interactable Object and stop touching it.
  3124. #### ForceStopSecondaryGrabInteraction/0
  3125. > `public virtual void ForceStopSecondaryGrabInteraction()`
  3126. * Parameters
  3127. * _none_
  3128. * Returns
  3129. * _none_
  3130. The ForceStopSecondaryGrabInteraction method forces the Interactable Object to no longer be influenced by the second controller grabbing it.
  3131. #### RegisterTeleporters/0
  3132. > `public virtual void RegisterTeleporters()`
  3133. * Parameters
  3134. * _none_
  3135. * Returns
  3136. * _none_
  3137. The RegisterTeleporters method is used to find all GameObjects that have a teleporter script and register the Interactable Object on the `OnTeleported` event.
  3138. #### UnregisterTeleporters/0
  3139. > `public virtual void UnregisterTeleporters()`
  3140. * Parameters
  3141. * _none_
  3142. * Returns
  3143. * _none_
  3144. The UnregisterTeleporters method is used to unregister all teleporter events that are active on this Interactable Object.
  3145. #### StoreLocalScale/0
  3146. > `public virtual void StoreLocalScale()`
  3147. * Parameters
  3148. * _none_
  3149. * Returns
  3150. * _none_
  3151. the StoreLocalScale method saves the current transform local scale values.
  3152. #### ToggleSnapDropZone/2
  3153. > `public virtual void ToggleSnapDropZone(VRTK_SnapDropZone snapDropZone, bool state)`
  3154. * Parameters
  3155. * `VRTK_SnapDropZone snapDropZone` - The Snap Drop Zone object that is being interacted with.
  3156. * `bool state` - The state of whether the Interactable Object is fixed in or removed from the Snap Drop Zone. `true` denotes the Interactable Object is snapped to the Snap Drop Zone and `false` denotes it has been removed from the Snap Drop Zone.
  3157. * Returns
  3158. * _none_
  3159. The ToggleSnapDropZone method is used to set the state of whether the Interactable Object is in a Snap Drop Zone or not.
  3160. #### IsInSnapDropZone/0
  3161. > `public virtual bool IsInSnapDropZone()`
  3162. * Parameters
  3163. * _none_
  3164. * Returns
  3165. * `bool` - Returns `true` if the Interactable Object is currently snapped in a Snap Drop Zone, returns `false` if it is not.
  3166. The IsInSnapDropZone method determines whether the Interactable Object is currently snapped to a Snap Drop Zone.
  3167. #### SetSnapDropZoneHover/2
  3168. > `public virtual void SetSnapDropZoneHover(VRTK_SnapDropZone snapDropZone, bool state)`
  3169. * Parameters
  3170. * `VRTK_SnapDropZone snapDropZone` - The Snap Drop Zone that is being interacted with.
  3171. * `bool state` - The state of whether the Interactable Object is being hovered or not.
  3172. * Returns
  3173. * _none_
  3174. The SetSnapDropZoneHover method sets whether the Interactable Object is currently being hovered over a valid Snap Drop Zone.
  3175. #### GetStoredSnapDropZone/0
  3176. > `public virtual VRTK_SnapDropZone GetStoredSnapDropZone()`
  3177. * Parameters
  3178. * _none_
  3179. * Returns
  3180. * `VRTK_SnapDropZone` - The SnapDropZone that the Interactable Object is currently snapped to.
  3181. The GetStoredSnapDropZone method returns the Snap Drop Zone that the Interactable Object is currently snapped to.
  3182. #### IsHoveredOverSnapDropZone/0
  3183. > `public virtual bool IsHoveredOverSnapDropZone()`
  3184. * Parameters
  3185. * _none_
  3186. * Returns
  3187. * `bool` - Returns `true` if the Interactable Object is currently hovering over a Snap Drop Zone.
  3188. The IsHoveredOverSnapDropZone method returns whether the Interactable Object is currently hovering over a Snap Drop Zone.
  3189. #### IsDroppable/0
  3190. > `public virtual bool IsDroppable()`
  3191. * Parameters
  3192. * _none_
  3193. * Returns
  3194. * `bool` - Returns `true` if the Interactable Object can currently be dropped, returns `false` if it is not currently possible to drop.
  3195. The IsDroppable method returns whether the Interactable Object can be dropped or not in it's current situation.
  3196. #### IsSwappable/0
  3197. > `public virtual bool IsSwappable()`
  3198. * Parameters
  3199. * _none_
  3200. * Returns
  3201. * `bool` - Returns `true` if the Interactable Object can be grabbed by a secondary interacting object whilst already being grabbed and the Interactable Object will swap controllers. Returns `false` if the Interactable Object cannot be swapped.
  3202. The IsSwappable method returns whether the Interactable Object can be grabbed with one interacting object and then swapped to another interacting object by grabbing with the secondary grab action.
  3203. #### PerformSecondaryAction/0
  3204. > `public virtual bool PerformSecondaryAction()`
  3205. * Parameters
  3206. * _none_
  3207. * Returns
  3208. * `bool` - Returns `true` if the Interactable Object has a Secondary Grab Action, returns `false` if it has no Secondary Grab Action or is swappable.
  3209. The PerformSecondaryAction method returns whether the Interactable Object has a Secondary Grab Action that can be performed when grabbing the object with a secondary interacting object.
  3210. #### ResetIgnoredColliders/0
  3211. > `public virtual void ResetIgnoredColliders()`
  3212. * Parameters
  3213. * _none_
  3214. * Returns
  3215. * _none_
  3216. The ResetIgnoredColliders method is used to clear any stored ignored colliders in case the `Ignored Colliders` array parameter is changed at runtime. This needs to be called manually if changes are made at runtime.
  3217. #### SubscribeToInteractionEvent/2
  3218. > `public virtual void SubscribeToInteractionEvent(InteractionType givenType, InteractableObjectEventHandler methodCallback)`
  3219. * Parameters
  3220. * `InteractionType givenType` - The Interaction Type to register the events for.
  3221. * `InteractableObjectEventHandler methodCallback` - The method to execute when the Interaction Type is initiated.
  3222. * Returns
  3223. * _none_
  3224. The SubscribeToInteractionEvent method subscribes a given method callback for the given Interaction Type.
  3225. #### UnsubscribeFromInteractionEvent/2
  3226. > `public virtual void UnsubscribeFromInteractionEvent(InteractionType givenType, InteractableObjectEventHandler methodCallback)`
  3227. * Parameters
  3228. * `InteractionType givenType` - The Interaction Type that the previous event subscription was under.
  3229. * `InteractableObjectEventHandler methodCallback` - The method that was being executed when the Interaction Type was initiated.
  3230. * Returns
  3231. * _none_
  3232. The UnsubscribeFromInteractionEvent method unsubscribes a previous event subscription for the given Interaction Type.
  3233. #### GetPrimaryAttachPoint/0
  3234. > `public virtual Transform GetPrimaryAttachPoint()`
  3235. * Parameters
  3236. * _none_
  3237. * Returns
  3238. * `Transform` - A Transform that denotes where the primary grabbing object is grabbing the Interactable Object at.
  3239. The GetPrimaryAttachPoint returns the Transform that determines where the primary grabbing object is grabbing the Interactable Object at.
  3240. #### GetSecondaryAttachPoint/0
  3241. > `public virtual Transform GetSecondaryAttachPoint()`
  3242. * Parameters
  3243. * _none_
  3244. * Returns
  3245. * `Transform` - A Transform that denotes where the secondary grabbing object is grabbing the Interactable Object at.
  3246. The GetSecondaryAttachPoint returns the Transform that determines where the secondary grabbing object is grabbing the Interactable Object at.
  3247. ### Example
  3248. `VRTK/Examples/005_Controller_BasicObjectGrabbing` uses the `VRTK_InteractTouch` and `VRTK_InteractGrab` scripts on the controllers to show how an interactable object can be grabbed and snapped to the controller and thrown around the game world.
  3249. `VRTK/Examples/013_Controller_UsingAndGrabbingMultipleObjects` shows multiple objects that can be grabbed by holding the buttons or grabbed by toggling the button click and also has objects that can have their Using state toggled to show how multiple items can be turned on at the same time.
  3250. ---
  3251. ## Interactable Listener (VRTK_InteractableListener)
  3252. ### Overview
  3253. Provides a base that classes which require to subscribe to the interaction events of an Interactable Object can inherit from.
  3254. **Script Usage:**
  3255. > This is an abstract class that is to be inherited to a concrete class that provides interaction event listener functionality, therefore this script should not be directly used.
  3256. ---
  3257. ## Interact Haptics (VRTK_InteractHaptics)
  3258. > extends [VRTK_InteractableListener](#interactable-listener-vrtk_interactablelistener)
  3259. ### Overview
  3260. Provides controller haptics upon interaction with the specified Interactable Object.
  3261. **Required Components:**
  3262. * `VRTK_InteractableObject` - The Interactable Object component to detect interactions on. This must be applied on the same GameObject as this script if one is not provided via the `Object To Affect` parameter.
  3263. **Script Usage:**
  3264. * Place the `VRTK_InteractHaptics` script on either:
  3265. * The GameObject of the Interactable Object to detect interactions on.
  3266. * Any other scene GameObject and provide a valid `VRTK_InteractableObject` component to the `Object To Affect` parameter of this script.
  3267. ### Inspector Parameters
  3268. * **Clip On Near Touch:** Denotes the audio clip to use to rumble the controller on near touch.
  3269. * **Strength On Near Touch:** Denotes how strong the rumble in the controller will be on near touch.
  3270. * **Duration On Near Touch:** Denotes how long the rumble in the controller will last on near touch.
  3271. * **Interval On Near Touch:** Denotes interval betweens rumble in the controller on near touch.
  3272. * **Cancel On Near Untouch:** If this is checked then the rumble will be cancelled when the controller is no longer near touching.
  3273. * **Clip On Touch:** Denotes the audio clip to use to rumble the controller on touch.
  3274. * **Strength On Touch:** Denotes how strong the rumble in the controller will be on touch.
  3275. * **Duration On Touch:** Denotes how long the rumble in the controller will last on touch.
  3276. * **Interval On Touch:** Denotes interval betweens rumble in the controller on touch.
  3277. * **Cancel On Untouch:** If this is checked then the rumble will be cancelled when the controller is no longer touching.
  3278. * **Clip On Grab:** Denotes the audio clip to use to rumble the controller on grab.
  3279. * **Strength On Grab:** Denotes how strong the rumble in the controller will be on grab.
  3280. * **Duration On Grab:** Denotes how long the rumble in the controller will last on grab.
  3281. * **Interval On Grab:** Denotes interval betweens rumble in the controller on grab.
  3282. * **Cancel On Ungrab:** If this is checked then the rumble will be cancelled when the controller is no longer grabbing.
  3283. * **Clip On Use:** Denotes the audio clip to use to rumble the controller on use.
  3284. * **Strength On Use:** Denotes how strong the rumble in the controller will be on use.
  3285. * **Duration On Use:** Denotes how long the rumble in the controller will last on use.
  3286. * **Interval On Use:** Denotes interval betweens rumble in the controller on use.
  3287. * **Cancel On Unuse:** If this is checked then the rumble will be cancelled when the controller is no longer using.
  3288. * **Object To Affect:** The Interactable Object to initiate the haptics from. If this is left blank, then the Interactable Object will need to be on the current or a parent GameObject.
  3289. ### Class Events
  3290. * `InteractHapticsNearTouched` - Emitted when the haptics are from a near touch.
  3291. * `InteractHapticsTouched` - Emitted when the haptics are from a touch.
  3292. * `InteractHapticsGrabbed` - Emitted when the haptics are from a grab.
  3293. * `InteractHapticsUsed` - Emitted when the haptics are from a use.
  3294. ### Unity Events
  3295. Adding the `VRTK_InteractHaptics_UnityEvents` component to `VRTK_InteractHaptics` object allows access to `UnityEvents` that will react identically to the Class Events.
  3296. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  3297. ### Event Payload
  3298. * `VRTK_ControllerReference controllerReference` - The reference to the controller to perform haptics on.
  3299. ### Class Methods
  3300. #### CancelHaptics/1
  3301. > `public virtual void CancelHaptics(VRTK_ControllerReference controllerReference)`
  3302. * Parameters
  3303. * `VRTK_ControllerReference controllerReference` -
  3304. * Returns
  3305. * _none_
  3306. The CancelHaptics method cancels any existing haptic feedback on the given controller.
  3307. #### HapticsOnNearTouch/1
  3308. > `public virtual void HapticsOnNearTouch(VRTK_ControllerReference controllerReference)`
  3309. * Parameters
  3310. * `VRTK_ControllerReference controllerReference` - The reference to the controller to activate the haptic feedback on.
  3311. * Returns
  3312. * _none_
  3313. The HapticsOnNearTouch method triggers the haptic feedback on the given controller for the settings associated with near touch.
  3314. #### HapticsOnTouch/1
  3315. > `public virtual void HapticsOnTouch(VRTK_ControllerReference controllerReference)`
  3316. * Parameters
  3317. * `VRTK_ControllerReference controllerReference` - The reference to the controller to activate the haptic feedback on.
  3318. * Returns
  3319. * _none_
  3320. The HapticsOnTouch method triggers the haptic feedback on the given controller for the settings associated with touch.
  3321. #### HapticsOnGrab/1
  3322. > `public virtual void HapticsOnGrab(VRTK_ControllerReference controllerReference)`
  3323. * Parameters
  3324. * `VRTK_ControllerReference controllerReference` - The reference to the controller to activate the haptic feedback on.
  3325. * Returns
  3326. * _none_
  3327. The HapticsOnGrab method triggers the haptic feedback on the given controller for the settings associated with grab.
  3328. #### HapticsOnUse/1
  3329. > `public virtual void HapticsOnUse(VRTK_ControllerReference controllerReference)`
  3330. * Parameters
  3331. * `VRTK_ControllerReference controllerReference` - The reference to the controller to activate the haptic feedback on.
  3332. * Returns
  3333. * _none_
  3334. The HapticsOnUse method triggers the haptic feedback on the given controller for the settings associated with use.
  3335. ---
  3336. ## Interact Object Appearance (VRTK_InteractObjectAppearance)
  3337. > extends [VRTK_InteractableListener](#interactable-listener-vrtk_interactablelistener)
  3338. ### Overview
  3339. Determine whether the `Object To Affect` should be visible or hidden by default or on interaction (near touch, touch, grab, use).
  3340. **Required Components:**
  3341. * `VRTK_InteractableObject` - The Interactable Object component to detect interactions on. This must be applied on the same GameObject as this script if one is not provided via the `Object To Monitor` parameter.
  3342. **Script Usage:**
  3343. * Place the `VRTK_InteractObjectAppearance` script on either:
  3344. * The GameObject of the Interactable Object to detect interactions on.
  3345. * Any other scene GameObject and provide a valid `VRTK_InteractableObject` component to the `Object To Monitor` parameter of this script.
  3346. * Optionally provide a GameObject to the `Object To Affect` parameter to determine which GameObject to affect the appearance of.
  3347. ### Inspector Parameters
  3348. * **Object To Affect:** The GameObject to affect the appearance of. If this is null then then the interacting object will be used (usually the controller).
  3349. * **Game Object Active By Default:** If this is checked then the `Object To Affect` will be an active GameObject when the script is enabled. If it's unchecked then it will be disabled. This only takes effect if `Affect Interacting Object` is unticked.
  3350. * **Renderer Visible By Default:** If this is checked then the `Object To Affect` will have visible renderers when the script is enabled. If it's unchecked then it will have it's renderers disabled. This only takes effect if `Affect Interacting Object` is unticked.
  3351. * **Game Object Active On Near Touch:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is near touched. If it's unchecked then it will be disabled on near touch.
  3352. * **Renderer Visible On Near Touch:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is near touched. If it's unchecked then it will have it's renderers disabled on near touch.
  3353. * **Near Touch Appearance Delay:** The amount of time to wait before the near touch appearance settings are applied after the near touch event.
  3354. * **Near Untouch Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the near untouch event.
  3355. * **Valid Near Touch Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the near touch and near untouch event.
  3356. * **Game Object Active On Touch:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is touched. If it's unchecked then it will be disabled on touch.
  3357. * **Renderer Visible On Touch:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is touched. If it's unchecked then it will have it's renderers disabled on touch.
  3358. * **Touch Appearance Delay:** The amount of time to wait before the touch appearance settings are applied after the touch event.
  3359. * **Untouch Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the untouch event.
  3360. * **Valid Touch Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the touch/untouch event.
  3361. * **Game Object Active On Grab:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is grabbed. If it's unchecked then it will be disabled on grab.
  3362. * **Renderer Visible On Grab:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is grabbed. If it's unchecked then it will have it's renderers disabled on grab.
  3363. * **Grab Appearance Delay:** The amount of time to wait before the grab appearance settings are applied after the grab event.
  3364. * **Ungrab Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the ungrab event.
  3365. * **Valid Grab Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the grab/ungrab event.
  3366. * **Game Object Active On Use:** If this is checked then the `Object To Affect` will be an active GameObject when the `Object To Monitor` is used. If it's unchecked then it will be disabled on use.
  3367. * **Renderer Visible On Use:** If this is checked then the `Object To Affect` will have visible renderers when the `Object To Monitor` is used. If it's unchecked then it will have it's renderers disabled on use.
  3368. * **Use Appearance Delay:** The amount of time to wait before the use appearance settings are applied after the use event.
  3369. * **Unuse Appearance Delay:** The amount of time to wait before the previous appearance settings are applied after the unuse event.
  3370. * **Valid Use Interacting Object:** Determines what type of interacting object will affect the appearance of the `Object To Affect` after the use/unuse event.
  3371. ### Class Variables
  3372. * `public enum ValidInteractingObject` - The valid interacting object.
  3373. * `Anything` - Any GameObject is considered a valid interacting object.
  3374. * `EitherController` - Only a game controller is considered a valid interacting objcet.
  3375. * `NeitherController` - Any GameObject except a game controller is considered a valid interacting object.
  3376. * `LeftControllerOnly` - Only the left game controller is considered a valid interacting objcet.
  3377. * `RightControllerOnly` - Only the right game controller is considered a valid interacting objcet.
  3378. ### Class Events
  3379. * `GameObjectEnabled` - Emitted when the GameObject on the `Object To Affect` is enabled.
  3380. * `GameObjectDisabled` - Emitted when the GameObject on the `Object To Affect` is disabled.
  3381. * `RenderersEnabled` - Emitted when the Renderers on the `Object To Affect` are enabled.
  3382. * `RenderersDisabled` - Emitted when the Renderers on the `Object To Affect` are disabled.
  3383. ### Unity Events
  3384. Adding the `VRTK_InteractObjectAppearance_UnityEvents` component to `VRTK_InteractObjectAppearance` object allows access to `UnityEvents` that will react identically to the Class Events.
  3385. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  3386. ### Event Payload
  3387. * `GameObject affectingObject` - The GameObject that is being affected.
  3388. * `VRTK_InteractableObject monitoringObject` - The Interactable Object that is being monitored.
  3389. * `VRTK_InteractableObject.InteractionType interactionType` - The type of interaction initiating the event.
  3390. ### Example
  3391. `VRTK/Examples/008_Controller_UsingAGrabbedObject` shows that the controller can be hidden when touching, grabbing and using an object.
  3392. ---
  3393. ## Interact Object Highlighter (VRTK_InteractObjectHighlighter)
  3394. > extends [VRTK_InteractableListener](#interactable-listener-vrtk_interactablelistener)
  3395. ### Overview
  3396. Enable highlighting of an Interactable Object base on interaction type.
  3397. **Required Components:**
  3398. * `VRTK_InteractableObject` - The Interactable Object component to detect interactions on. This must be applied on the same GameObject as this script if one is not provided via the `Object To Monitor` parameter.
  3399. **Optional Components:**
  3400. * `VRTK_BaseHighlighter` - The highlighter to use when highligting the Object. If one is not already injected in the `Object Highlighter` parameter then the component on the same GameObject will be used.
  3401. **Script Usage:**
  3402. * Place the `VRTK_InteractObjectHighlighter` script on either:
  3403. * The GameObject of the Interactable Object to detect interactions on.
  3404. * Any other scene GameObject and provide a valid `VRTK_InteractableObject` component to the `Object To Affect` parameter of this script.
  3405. ### Inspector Parameters
  3406. * **Near Touch Highlight:** The colour to highlight the object on the near touch interaction.
  3407. * **Touch Highlight:** The colour to highlight the object on the touch interaction.
  3408. * **Grab Highlight:** The colour to highlight the object on the grab interaction.
  3409. * **Use Highlight:** The colour to highlight the object on the use interaction.
  3410. * **Object To Highlight:** The GameObject to highlight.
  3411. * **Object Highlighter:** An optional Highlighter to use when highlighting the specified Object. If this is left blank, then the first active highlighter on the same GameObject will be used, if one isn't found then a Material Color Swap Highlighter will be created at runtime.
  3412. ### Class Events
  3413. * `InteractObjectHighlighterHighlighted` - Emitted when the object is highlighted
  3414. * `InteractObjectHighlighterUnhighlighted` - Emitted when the object is unhighlighted
  3415. ### Unity Events
  3416. Adding the `VRTK_InteractObjectHighlighter_UnityEvents` component to `VRTK_InteractObjectHighlighter` object allows access to `UnityEvents` that will react identically to the Class Events.
  3417. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  3418. ### Event Payload
  3419. * `VRTK_InteractableObject.InteractionType interactionType` - The type of interaction occuring on the object to monitor.
  3420. * `Color highlightColor` - The colour being provided to highlight the affected object with.
  3421. * `GameObject affectingObject` - The GameObject is initiating the highlight via an interaction.
  3422. * `VRTK_InteractableObject objectToMonitor` - The Interactable Object that is being interacted with.
  3423. * `GameObject affectedObject` - The GameObject that is being highlighted.
  3424. ### Class Methods
  3425. #### ResetHighlighter/0
  3426. > `public virtual void ResetHighlighter()`
  3427. * Parameters
  3428. * _none_
  3429. * Returns
  3430. * _none_
  3431. The ResetHighlighter method is used to reset the currently attached highlighter.
  3432. #### Highlight/1
  3433. > `public virtual void Highlight(Color highlightColor)`
  3434. * Parameters
  3435. * `Color highlightColor` - The colour to apply to the highlighter.
  3436. * Returns
  3437. * _none_
  3438. The Highlight method turns on the highlighter with the given Color.
  3439. #### Unhighlight/0
  3440. > `public virtual void Unhighlight()`
  3441. * Parameters
  3442. * _none_
  3443. * Returns
  3444. * _none_
  3445. The Unhighlight method turns off the highlighter.
  3446. #### GetCurrentHighlightColor/0
  3447. > `public virtual Color GetCurrentHighlightColor()`
  3448. * Parameters
  3449. * _none_
  3450. * Returns
  3451. * `Color` - The Color that the Interactable Object is being highlighted to.
  3452. The GetCurrentHighlightColor returns the colour that the Interactable Object is currently being highlighted to.
  3453. ---
  3454. ## Object Touch Auto Interact (VRTK_ObjectTouchAutoInteract)
  3455. > extends [VRTK_InteractableListener](#interactable-listener-vrtk_interactablelistener)
  3456. ### Overview
  3457. Allows for Interact Grab or Interact Use interactions to automatically happen upon touching an Interactable Object.
  3458. **Required Components:**
  3459. * `VRTK_InteractableObject` - The Interactable Object component to detect interactions on. This must be applied on the same GameObject as this script if one is not provided via the `Interactable Object` parameter.
  3460. **Script Usage:**
  3461. * Place the `VRTK_ObjectTouchAutoInteract` script on either:
  3462. * The GameObject of the Interactable Object to detect interactions on.
  3463. * Any other scene GameObject and provide a valid `VRTK_InteractableObject` component to the `Interactable Object` parameter of this script.
  3464. ### Inspector Parameters
  3465. * **Grab On Touch When:** Determines when a grab on touch should occur.
  3466. * **Regrab Delay:** After being ungrabbed, another auto grab on touch can only occur after this time.
  3467. * **Continuous Grab Check:** If this is checked then the grab on touch check will happen every frame and not only on the first touch of the Interactable Object.
  3468. * **Use On Touch When:** Determines when a use on touch should occur.
  3469. * **Reuse Delay:** After being unused, another auto use on touch can only occur after this time.
  3470. * **Continuous Use Check:** If this is checked then the use on touch check will happen every frame and not only on the first touch of the Interactable Object.
  3471. * **Interactable Object:** The Interactable Object that the auto interaction will occur on. If this is blank then the script must be on the same GameObject as the Interactable Object script.
  3472. ### Class Variables
  3473. * `public enum AutoInteractions` - Situation when auto interaction can occur.
  3474. * `Never` - Auto interaction can never occur on touch.
  3475. * `NoButtonHeld` - Auto interaction will occur on touch even if the specified interaction button is not held down.
  3476. * `ButtonHeld` - Auto interaction will only occur on touch if the specified interaction button is held down.
  3477. ---
  3478. ## Ignore Interact Touch Colliders (VRTK_IgnoreInteractTouchColliders)
  3479. > extends VRTK_SDKControllerReady
  3480. ### Overview
  3481. Ignores the collisions between the given Interact Touch colliders and the colliders on the GameObject this script is attached to.
  3482. **Required Components:**
  3483. * `Collider` - Unity Colliders on the current GameObject or child GameObjects to ignore collisions from the given Interact Touch colliders.
  3484. **Script Usage:**
  3485. * Place the `VRTK_IgnoreInteractTouchColliders` script on the GameObject with colliders to ignore collisions from the given Interact Touch colliders.
  3486. * Increase the size of the `Interact Touch To Ignore` element list.
  3487. * Add the appropriate GameObjects that have the `VRTK_InteractTouch` script attached to use when ignoring collisions with the colliders on GameObject the script is attached to.
  3488. ### Inspector Parameters
  3489. * **Interact Touch To Ignore:** The Interact Touch scripts to ignore collisions with.
  3490. * **Skip Ignore:** A collection of GameObjects to not include when ignoring collisions with the provided Interact Touch colliders.
  3491. ---
  3492. # Grab Attach Mechanics (VRTK/Source/Scripts/Interactions/GrabAttachMechanics)
  3493. A collection of scripts that are used to provide different mechanics to apply when grabbing an interactable object.
  3494. * [Base Grab Attach](#base-grab-attach-vrtk_basegrabattach)
  3495. * [Base Joint Grab Attach](#base-joint-grab-attach-vrtk_basejointgrabattach)
  3496. * [Fixed Joint Grab Attach](#fixed-joint-grab-attach-vrtk_fixedjointgrabattach)
  3497. * [Spring Joint Grab Attach](#spring-joint-grab-attach-vrtk_springjointgrabattach)
  3498. * [Custom Joint Grab Attach](#custom-joint-grab-attach-vrtk_customjointgrabattach)
  3499. * [Child Of Controller Grab Attach](#child-of-controller-grab-attach-vrtk_childofcontrollergrabattach)
  3500. * [Track Object Grab Attach](#track-object-grab-attach-vrtk_trackobjectgrabattach)
  3501. * [Rotator Track Grab Attach](#rotator-track-grab-attach-vrtk_rotatortrackgrabattach)
  3502. * [Climbable Grab Attach](#climbable-grab-attach-vrtk_climbablegrabattach)
  3503. * [Control Animation Grab Attach](#control-animation-grab-attach-vrtk_controlanimationgrabattach)
  3504. * [Move Transform Grab Attach](#move-transform-grab-attach-vrtk_movetransformgrabattach)
  3505. * [Rotate Transform Grab Attach](#rotate-transform-grab-attach-vrtk_rotatetransformgrabattach)
  3506. ---
  3507. ## Base Grab Attach (VRTK_BaseGrabAttach)
  3508. ### Overview
  3509. Provides a base that all grab attach mechanics can inherit from.
  3510. **Script Usage:**
  3511. > This is an abstract class that is to be inherited to a concrete class that provides grab attach functionality, therefore this script should not be directly used.
  3512. ### Inspector Parameters
  3513. * **Precision Grab:** If this is checked then when the Interact Grab grabs the Interactable Object, it will grab it with precision and pick it up at the particular point on the Interactable Object that the Interact Touch is touching.
  3514. * **Right Snap Handle:** A Transform provided as an empty GameObject which must be the child of the Interactable Object being grabbed and serves as an orientation point to rotate and position the grabbed Interactable Object in relation to the right handed Interact Grab. If no Right Snap Handle is provided but a Left Snap Handle is provided, then the Left Snap Handle will be used in place. If no Snap Handle is provided then the Interactable Object will be grabbed at its central point. Not required for `Precision Grab`.
  3515. * **Left Snap Handle:** A Transform provided as an empty GameObject which must be the child of the Interactable Object being grabbed and serves as an orientation point to rotate and position the grabbed Interactable Object in relation to the left handed Interact Grab. If no Left Snap Handle is provided but a Right Snap Handle is provided, then the Right Snap Handle will be used in place. If no Snap Handle is provided then the Interactable Object will be grabbed at its central point. Not required for `Precision Grab`.
  3516. * **Throw Velocity With Attach Distance:** If checked then when the Interactable Object is thrown, the distance between the Interactable Object's attach point and the Interact Grab's attach point will be used to calculate a faster throwing velocity.
  3517. * **Throw Multiplier:** An amount to multiply the velocity of the given Interactable Object when it is thrown. This can also be used in conjunction with the Interact Grab Throw Multiplier to have certain Interactable Objects be thrown even further than normal (or thrown a shorter distance if a number below 1 is entered).
  3518. * **On Grab Collision Delay:** The amount of time to delay collisions affecting the Interactable Object when it is first grabbed. This is useful if the Interactable Object could get stuck inside another GameObject when it is being grabbed.
  3519. ### Class Methods
  3520. #### IsTracked/0
  3521. > `public virtual bool IsTracked()`
  3522. * Parameters
  3523. * _none_
  3524. * Returns
  3525. * `bool` - Is true if the mechanic is of type tracked.
  3526. The IsTracked method determines if the grab attach mechanic is a track object type.
  3527. #### IsClimbable/0
  3528. > `public virtual bool IsClimbable()`
  3529. * Parameters
  3530. * _none_
  3531. * Returns
  3532. * `bool` - Is true if the mechanic is of type climbable.
  3533. The IsClimbable method determines if the grab attach mechanic is a climbable object type.
  3534. #### IsKinematic/0
  3535. > `public virtual bool IsKinematic()`
  3536. * Parameters
  3537. * _none_
  3538. * Returns
  3539. * `bool` - Is true if the mechanic is of type kinematic.
  3540. The IsKinematic method determines if the grab attach mechanic is a kinematic object type.
  3541. #### ValidGrab/1
  3542. > `public virtual bool ValidGrab(Rigidbody checkAttachPoint)`
  3543. * Parameters
  3544. * `Rigidbody checkAttachPoint` - The rigidbody attach point to check.
  3545. * Returns
  3546. * `bool` - Always returns `true` for the base check.
  3547. The ValidGrab method determines if the grab attempt is valid.
  3548. #### SetTrackPoint/1
  3549. > `public virtual void SetTrackPoint(Transform givenTrackPoint)`
  3550. * Parameters
  3551. * `Transform givenTrackPoint` - The track point to set on the grabbed Interactable Object.
  3552. * Returns
  3553. * _none_
  3554. The SetTrackPoint method sets the point on the grabbed Interactable Object where the grab is happening.
  3555. #### SetInitialAttachPoint/1
  3556. > `public virtual void SetInitialAttachPoint(Transform givenInitialAttachPoint)`
  3557. * Parameters
  3558. * `Transform givenInitialAttachPoint` - The point where the initial grab took place.
  3559. * Returns
  3560. * _none_
  3561. The SetInitialAttachPoint method sets the point on the grabbed Interactable Object where the initial grab happened.
  3562. #### StartGrab/3
  3563. > `public virtual bool StartGrab(GameObject grabbingObject, GameObject givenGrabbedObject, Rigidbody givenControllerAttachPoint)`
  3564. * Parameters
  3565. * `GameObject grabbingObject` - The GameObject that is doing the grabbing.
  3566. * `GameObject givenGrabbedObject` - The GameObject that is being grabbed.
  3567. * `Rigidbody givenControllerAttachPoint` - The point on the grabbing object that the grabbed object should be attached to after grab occurs.
  3568. * Returns
  3569. * `bool` - Returns `true` if the grab is successful, `false` if the grab is unsuccessful.
  3570. The StartGrab method sets up the grab attach mechanic as soon as an Interactable Object is grabbed.
  3571. #### StopGrab/1
  3572. > `public virtual void StopGrab(bool applyGrabbingObjectVelocity)`
  3573. * Parameters
  3574. * `bool applyGrabbingObjectVelocity` - If `true` will apply the current velocity of the grabbing object to the grabbed object on release.
  3575. * Returns
  3576. * _none_
  3577. The StopGrab method ends the grab of the current Interactable Object and cleans up the state.
  3578. #### CreateTrackPoint/4
  3579. > `public virtual Transform CreateTrackPoint(Transform controllerPoint, GameObject currentGrabbedObject, GameObject currentGrabbingObject, ref bool customTrackPoint)`
  3580. * Parameters
  3581. * `Transform controllerPoint` - The point on the controller where the grab was initiated.
  3582. * `GameObject currentGrabbedObject` - The GameObject that is currently being grabbed.
  3583. * `GameObject currentGrabbingObject` - The GameObject that is currently doing the grabbing.
  3584. * `ref bool customTrackPoint` - A reference to whether the created track point is an auto generated custom object.
  3585. * Returns
  3586. * `Transform` - The Transform of the created track point.
  3587. The CreateTrackPoint method sets up the point of grab to track on the grabbed object.
  3588. #### ProcessUpdate/0
  3589. > `public virtual void ProcessUpdate()`
  3590. * Parameters
  3591. * _none_
  3592. * Returns
  3593. * _none_
  3594. The ProcessUpdate method is run in every Update method on the Interactable Object.
  3595. #### ProcessFixedUpdate/0
  3596. > `public virtual void ProcessFixedUpdate()`
  3597. * Parameters
  3598. * _none_
  3599. * Returns
  3600. * _none_
  3601. The ProcessFixedUpdate method is run in every FixedUpdate method on the Interactable Object.
  3602. #### ResetState/0
  3603. > `public virtual void ResetState()`
  3604. * Parameters
  3605. * _none_
  3606. * Returns
  3607. * _none_
  3608. The ResetState method re-initializes the grab attach.
  3609. ---
  3610. ## Base Joint Grab Attach (VRTK_BaseJointGrabAttach)
  3611. > extends [VRTK_BaseGrabAttach](#base-grab-attach-vrtk_basegrabattach)
  3612. ### Overview
  3613. Provides a base that all joint based grab attach mechanics can inherit from.
  3614. **Script Usage:**
  3615. > This is an abstract class that is to be inherited to a concrete class that provides joint based grab attach functionality, therefore this script should not be directly used.
  3616. ### Inspector Parameters
  3617. * **Destroy Immediately On Throw:** Determines whether the joint should be destroyed immediately on release or whether to wait till the end of the frame before being destroyed.
  3618. ### Class Methods
  3619. #### ValidGrab/1
  3620. > `public override bool ValidGrab(Rigidbody checkAttachPoint)`
  3621. * Parameters
  3622. * `Rigidbody checkAttachPoint` - The rigidbody attach point to check.
  3623. * Returns
  3624. * `bool` - Returns `true` if there is no current grab happening, or the grab is initiated by another grabbing object.
  3625. The ValidGrab method determines if the grab attempt is valid.
  3626. #### StartGrab/3
  3627. > `public override bool StartGrab(GameObject grabbingObject, GameObject givenGrabbedObject, Rigidbody givenControllerAttachPoint)`
  3628. * Parameters
  3629. * `GameObject grabbingObject` - The GameObject that is doing the grabbing.
  3630. * `GameObject givenGrabbedObject` - The GameObject that is being grabbed.
  3631. * `Rigidbody givenControllerAttachPoint` - The point on the grabbing object that the grabbed object should be attached to after grab occurs.
  3632. * Returns
  3633. * `bool` - Returns `true` if the grab is successful, `false` if the grab is unsuccessful.
  3634. The StartGrab method sets up the grab attach mechanic as soon as an Interactable Object is grabbed. It is also responsible for creating the joint on the grabbed object.
  3635. #### StopGrab/1
  3636. > `public override void StopGrab(bool applyGrabbingObjectVelocity)`
  3637. * Parameters
  3638. * `bool applyGrabbingObjectVelocity` - If `true` will apply the current velocity of the grabbing object to the grabbed object on release.
  3639. * Returns
  3640. * _none_
  3641. The StopGrab method ends the grab of the current Interactable Object and cleans up the state. It is also responsible for removing the joint from the grabbed object.
  3642. ---
  3643. ## Fixed Joint Grab Attach (VRTK_FixedJointGrabAttach)
  3644. > extends [VRTK_BaseJointGrabAttach](#base-joint-grab-attach-vrtk_basejointgrabattach)
  3645. ### Overview
  3646. Attaches the grabbed Interactable Object to the grabbing object via a Fixed Joint.
  3647. > The Interactable Object will be attached to the grabbing object via a Fixed Joint and the Joint can be broken upon colliding the Interactable Object with other colliders.
  3648. **Script Usage:**
  3649. * Place the `VRTK_FixedJointGrabAttach` script on either:
  3650. * The GameObject of the Interactable Object to detect interactions on.
  3651. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  3652. ### Inspector Parameters
  3653. * **Break Force:** Maximum force the Joint can withstand before breaking. Setting to `infinity` ensures the Joint is unbreakable.
  3654. ### Example
  3655. `VRTK/Examples/005_Controller_BasicObjectGrabbing` demonstrates this grab attach mechanic all of the grabbable objects in the scene.
  3656. ---
  3657. ## Spring Joint Grab Attach (VRTK_SpringJointGrabAttach)
  3658. > extends [VRTK_BaseJointGrabAttach](#base-joint-grab-attach-vrtk_basejointgrabattach)
  3659. ### Overview
  3660. Attaches the grabbed Interactable Object to the grabbing object via a Spring Joint.
  3661. > The Interactable Object will be attached to the grabbing object via a Spring Joint and the Joint can be broken upon colliding the Interactable Object with other colliders.
  3662. **Script Usage:**
  3663. * Place the `VRTK_SpringJointGrabAttach` script on either:
  3664. * The GameObject of the Interactable Object to detect interactions on.
  3665. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  3666. ### Inspector Parameters
  3667. * **Break Force:** Maximum force the Joint can withstand before breaking. Setting to `infinity` ensures the Joint is unbreakable.
  3668. * **Strength:** The strength of the spring.
  3669. * **Damper:** The amount of dampening to apply to the spring.
  3670. ### Example
  3671. `VRTK/Examples/021_Controller_GrabbingObjectsWithJoints` demonstrates this grab attach mechanic on the Drawer object in the scene.
  3672. ---
  3673. ## Custom Joint Grab Attach (VRTK_CustomJointGrabAttach)
  3674. > extends [VRTK_BaseJointGrabAttach](#base-joint-grab-attach-vrtk_basejointgrabattach)
  3675. ### Overview
  3676. Attaches the grabbed Interactable Object to the grabbing object via a custom Joint.
  3677. > The Interactable Object will be attached to the grabbing object via a custom Joint and the Joint can be broken upon colliding the Interactable Object with other colliders.
  3678. **Script Usage:**
  3679. * Place the `VRTK_CustomJointGrabAttach` script on either:
  3680. * The GameObject of the Interactable Object to detect interactions on.
  3681. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  3682. * Create a `Joint` component suitable for attaching the grabbed Interactable Object to the grabbing object with and provide it to the `Custom Joint` parameter.
  3683. ### Inspector Parameters
  3684. * **Custom Joint:** The joint to use for the grab attach joint.
  3685. ### Example
  3686. `VRTK/Examples/021_Controller_GrabbingObjectsWithJoints` demonstrates this grab attach mechanic on the Lamp object in the scene.
  3687. ---
  3688. ## Child Of Controller Grab Attach (VRTK_ChildOfControllerGrabAttach)
  3689. > extends [VRTK_BaseGrabAttach](#base-grab-attach-vrtk_basegrabattach)
  3690. ### Overview
  3691. Sets the grabbed Interactable Object to be a child of the grabbing object.
  3692. > The Interactable Object will have 1:1 tracking of the grabbing object, however it will also have reduced collision detection and will be able to pass through other colliders.
  3693. **Script Usage:**
  3694. * Place the `VRTK_ChildOfControllerGrabAttach` script on either:
  3695. * The GameObject of the Interactable Object to detect interactions on.
  3696. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  3697. ### Class Methods
  3698. #### StartGrab/3
  3699. > `public override bool StartGrab(GameObject grabbingObject, GameObject givenGrabbedObject, Rigidbody givenControllerAttachPoint)`
  3700. * Parameters
  3701. * `GameObject grabbingObject` - The GameObject that is doing the grabbing.
  3702. * `GameObject givenGrabbedObject` - The GameObject that is being grabbed.
  3703. * `Rigidbody givenControllerAttachPoint` - The point on the grabbing object that the grabbed object should be attached to after grab occurs.
  3704. * Returns
  3705. * `bool` - Returns `true` if the grab is successful, `false` if the grab is unsuccessful.
  3706. The StartGrab method sets up the grab attach mechanic as soon as an Interactable Object is grabbed. It is also responsible for creating the joint on the grabbed object.
  3707. #### StopGrab/1
  3708. > `public override void StopGrab(bool applyGrabbingObjectVelocity)`
  3709. * Parameters
  3710. * `bool applyGrabbingObjectVelocity` - If `true` will apply the current velocity of the grabbing object to the grabbed object on release.
  3711. * Returns
  3712. * _none_
  3713. The StopGrab method ends the grab of the current Interactable Object and cleans up the state.
  3714. ### Example
  3715. `VRTK/Examples/023_Controller_ChildOfControllerOnGrab` uses this grab attach mechanic for the bow and the arrow.
  3716. ---
  3717. ## Track Object Grab Attach (VRTK_TrackObjectGrabAttach)
  3718. > extends [VRTK_BaseGrabAttach](#base-grab-attach-vrtk_basegrabattach)
  3719. ### Overview
  3720. Applies velocity to the grabbed Interactable Object to ensure it tracks the position of the grabbing object.
  3721. > The Interactable Object follows the grabbing object based on velocity being applied and therefore fully interacts with all other scene Colliders but not at a true 1:1 tracking.
  3722. **Script Usage:**
  3723. * Place the `VRTK_TrackObjectGrabAttach` script on either:
  3724. * The GameObject of the Interactable Object to detect interactions on.
  3725. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  3726. ### Inspector Parameters
  3727. * **Detach Distance:** The maximum distance the grabbing object is away from the Interactable Object before it is automatically dropped.
  3728. * **Velocity Limit:** The maximum amount of velocity magnitude that can be applied to the Interactable Object. Lowering this can prevent physics glitches if Interactable Objects are moving too fast.
  3729. * **Angular Velocity Limit:** The maximum amount of angular velocity magnitude that can be applied to the Interactable Object. Lowering this can prevent physics glitches if Interactable Objects are moving too fast.
  3730. * **Max Distance Delta:** The maximum difference in distance to the tracked position.
  3731. ### Class Methods
  3732. #### StopGrab/1
  3733. > `public override void StopGrab(bool applyGrabbingObjectVelocity)`
  3734. * Parameters
  3735. * `bool applyGrabbingObjectVelocity` - If `true` will apply the current velocity of the grabbing object to the grabbed Interactable Object on release.
  3736. * Returns
  3737. * _none_
  3738. The StopGrab method ends the grab of the current Interactable Object and cleans up the state.
  3739. #### CreateTrackPoint/4
  3740. > `public override Transform CreateTrackPoint(Transform controllerPoint, GameObject currentGrabbedObject, GameObject currentGrabbingObject, ref bool customTrackPoint)`
  3741. * Parameters
  3742. * `Transform controllerPoint` - The point on the controller where the grab was initiated.
  3743. * `GameObject currentGrabbedObject` - The GameObject that is currently being grabbed.
  3744. * `GameObject currentGrabbingObject` - The GameObject that is currently doing the grabbing.
  3745. * `ref bool customTrackPoint` - A reference to whether the created track point is an auto generated custom object.
  3746. * Returns
  3747. * `Transform` - The Transform of the created track point.
  3748. The CreateTrackPoint method sets up the point of grab to track on the grabbed object.
  3749. #### ProcessUpdate/0
  3750. > `public override void ProcessUpdate()`
  3751. * Parameters
  3752. * _none_
  3753. * Returns
  3754. * _none_
  3755. The ProcessUpdate method is run in every Update method on the Interactable Object. It is responsible for checking if the tracked object has exceeded it's detach distance.
  3756. #### ProcessFixedUpdate/0
  3757. > `public override void ProcessFixedUpdate()`
  3758. * Parameters
  3759. * _none_
  3760. * Returns
  3761. * _none_
  3762. The ProcessFixedUpdate method is run in every FixedUpdate method on the Interactable Object. It applies velocity to the object to ensure it is tracking the grabbing object.
  3763. ### Example
  3764. `VRTK/Examples/021_Controller_GrabbingObjectsWithJoints` demonstrates this grab attach mechanic on the Chest handle and Fire Extinguisher body.
  3765. ---
  3766. ## Rotator Track Grab Attach (VRTK_RotatorTrackGrabAttach)
  3767. > extends [VRTK_TrackObjectGrabAttach](#track-object-grab-attach-vrtk_trackobjectgrabattach)
  3768. ### Overview
  3769. Applies a rotational force to the grabbed Interactable Object.
  3770. > The Interactable Object is not attached to the grabbing object but rather has a rotational force applied based on the rotation of the grabbing object.
  3771. **Script Usage:**
  3772. * Place the `VRTK_RotatorTrackGrabAttach` script on either:
  3773. * The GameObject of the Interactable Object to detect interactions on.
  3774. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  3775. ### Class Methods
  3776. #### StopGrab/1
  3777. > `public override void StopGrab(bool applyGrabbingObjectVelocity)`
  3778. * Parameters
  3779. * `bool applyGrabbingObjectVelocity` - If `true` will apply the current velocity of the grabbing object to the grabbed Interactable Object on release.
  3780. * Returns
  3781. * _none_
  3782. The StopGrab method ends the grab of the current Interactable Object and cleans up the state.
  3783. #### ProcessFixedUpdate/0
  3784. > `public override void ProcessFixedUpdate()`
  3785. * Parameters
  3786. * _none_
  3787. * Returns
  3788. * _none_
  3789. The ProcessFixedUpdate method is run in every FixedUpdate method on the Interactable Object. It applies a force to the grabbed Interactable Object to move it in the direction of the grabbing object.
  3790. ### Example
  3791. `VRTK/Examples/021_Controller_GrabbingObjectsWithJoints` demonstrates this grab attach mechanic on the Wheel and Door objects in the scene.
  3792. ---
  3793. ## Climbable Grab Attach (VRTK_ClimbableGrabAttach)
  3794. > extends [VRTK_BaseGrabAttach](#base-grab-attach-vrtk_basegrabattach)
  3795. ### Overview
  3796. Marks the Interactable Object as being climbable.
  3797. > The Interactable Object will not be grabbed to the controller, instead in conjunction with the `VRTK_PlayerClimb` script will enable the PlayArea to be moved around as if it was climbing.
  3798. **Script Usage:**
  3799. * Place the `VRTK_ClimbableGrabAttach` script on either:
  3800. * The GameObject of the Interactable Object to detect interactions on.
  3801. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  3802. ### Inspector Parameters
  3803. * **Use Object Rotation:** Will respect the grabbed climbing object's rotation if it changes dynamically
  3804. ### Example
  3805. `VRTK/Examples/037_CameraRig_ClimbingFalling` uses this grab attach mechanic for each item that is climbable in the scene.
  3806. ---
  3807. ## Control Animation Grab Attach (VRTK_ControlAnimationGrabAttach)
  3808. > extends [VRTK_BaseGrabAttach](#base-grab-attach-vrtk_basegrabattach)
  3809. ### Overview
  3810. Scrubs through the given animation based on the distance from the grabbing object to the original grabbing point.
  3811. **Script Usage:**
  3812. * Place the `VRTK_ControlAnimationGrabAttach` script on either:
  3813. * The GameObject of the Interactable Object to detect interactions on.
  3814. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  3815. * Create and apply an animation via:
  3816. * `Animation Timeline` parameter takes a legacy `Animation` component to use as the timeline to scrub through. The animation must be marked as `legacy` via the inspector in debug mode.
  3817. * `Animator Timeline` parameter takes an Animator component to use as the timeline to scrub through.
  3818. ### Inspector Parameters
  3819. * **Detach Distance:** The maximum distance the grabbing object is away from the Interactable Object before it is automatically released.
  3820. * **Animation Timeline:** An Animation with the timeline to scrub through on grab. If this is set then the `Animator Timeline` will be ignored if it is also set.
  3821. * **Animator Timeline:** An Animator with the timeline to scrub through on grab.
  3822. * **Max Frames:** The maximum amount of frames in the timeline.
  3823. * **Distance Multiplier:** An amount to multiply the distance by to determine the scrubbed frame to be on.
  3824. * **Rewind On Release:** If this is checked then the animation will rewind to the start on ungrab.
  3825. * **Rewind Speed Multplier:** The speed in which the animation rewind will be multiplied by.
  3826. ### Class Events
  3827. * `AnimationFrameAtStart` - Emitted when the Animation Frame is at the start.
  3828. * `AnimationFrameAtEnd` - Emitted when the Animation Frame is at the end.
  3829. * `AnimationFrameChanged` - Emitted when the Animation Frame has changed.
  3830. ### Unity Events
  3831. Adding the `VRTK_ControlAnimationGrabAttach_UnityEvents` component to `VRTK_ControlAnimationGrabAttach` object allows access to `UnityEvents` that will react identically to the Class Events.
  3832. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  3833. ### Event Payload
  3834. * `GameObject interactingObject` - The GameObject that is performing the interaction (e.g. a controller).
  3835. * `float currentFrame` - The current frame the animation is on.
  3836. ### Class Methods
  3837. #### StartGrab/3
  3838. > `public override bool StartGrab(GameObject grabbingObject, GameObject givenGrabbedObject, Rigidbody givenControllerAttachPoint)`
  3839. * Parameters
  3840. * `GameObject grabbingObject` - The GameObject that is doing the grabbing.
  3841. * `GameObject givenGrabbedObject` - The GameObject that is being grabbed.
  3842. * `Rigidbody givenControllerAttachPoint` - The point on the grabbing object that the grabbed object should be attached to after grab occurs.
  3843. * Returns
  3844. * `bool` - Returns `true` if the grab is successful, `false` if the grab is unsuccessful.
  3845. The StartGrab method sets up the grab attach mechanic as soon as an Interactable Object is grabbed.
  3846. #### StopGrab/1
  3847. > `public override void StopGrab(bool applyGrabbingObjectVelocity)`
  3848. * Parameters
  3849. * `bool applyGrabbingObjectVelocity` - If `true` will apply the current velocity of the grabbing object to the grabbed object on release.
  3850. * Returns
  3851. * _none_
  3852. The StopGrab method ends the grab of the current Interactable Object and cleans up the state.
  3853. #### CreateTrackPoint/4
  3854. > `public override Transform CreateTrackPoint(Transform controllerPoint, GameObject currentGrabbedObject, GameObject currentGrabbingObject, ref bool customTrackPoint)`
  3855. * Parameters
  3856. * `Transform controllerPoint` - The point on the controller where the grab was initiated.
  3857. * `GameObject currentGrabbedObject` - The GameObject that is currently being grabbed.
  3858. * `GameObject currentGrabbingObject` - The GameObject that is currently doing the grabbing.
  3859. * `ref bool customTrackPoint` - A reference to whether the created track point is an auto generated custom object.
  3860. * Returns
  3861. * `Transform` - The Transform of the created track point.
  3862. The CreateTrackPoint method sets up the point of grab to track on the grabbed object.
  3863. #### ProcessUpdate/0
  3864. > `public override void ProcessUpdate()`
  3865. * Parameters
  3866. * _none_
  3867. * Returns
  3868. * _none_
  3869. The ProcessUpdate method is run in every Update method on the Interactable Object.
  3870. #### SetFrame/1
  3871. > `public virtual void SetFrame(float frame)`
  3872. * Parameters
  3873. * `float frame` - The frame to scrub to.
  3874. * Returns
  3875. * _none_
  3876. The SetFrame method scrubs to the specific frame of the Animator timeline.
  3877. #### RewindAnimation/0
  3878. > `public virtual void RewindAnimation()`
  3879. * Parameters
  3880. * _none_
  3881. * Returns
  3882. * _none_
  3883. The RewindAnimation method will force the animation to rewind to the start frame.
  3884. ---
  3885. ## Move Transform Grab Attach (VRTK_MoveTransformGrabAttach)
  3886. > extends [VRTK_BaseGrabAttach](#base-grab-attach-vrtk_basegrabattach)
  3887. ### Overview
  3888. Moves the Transform of the Interactable Object towards the interacting object within specified limits.
  3889. > To allow unrestricted movement, set the axis limit minimum to `-infinity` and the axis limit maximum to `infinity`.
  3890. **Script Usage:**
  3891. * Place the `VRTK_MoveTransformGrabAttach` script on either:
  3892. * The GameObject of the Interactable Object to detect interactions on.
  3893. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  3894. ### Inspector Parameters
  3895. * **Detach Distance:** The maximum distance the grabbing object is away from the Interactable Object before it is automatically released.
  3896. * **Tracking Speed:** The speed in which to track the grabbed Interactable Object to the interacting object.
  3897. * **Force Kinematic On Grab:** If this is checked then it will force the rigidbody on the Interactable Object to be `Kinematic` when the grab occurs.
  3898. * **Release Deceleration Damper:** The damper in which to slow the Interactable Object down when released to simulate continued momentum. The higher the number, the faster the Interactable Object will come to a complete stop on release.
  3899. * **Reset To Orign On Release Speed:** The speed in which the Interactable Object returns to it's origin position when released. If the `Reset To Orign On Release Speed` is `0f` then the position will not be reset.
  3900. * **X Axis Limits:** The minimum and maximum limits the Interactable Object can be moved along the x axis.
  3901. * **Y Axis Limits:** The minimum and maximum limits the Interactable Object can be moved along the y axis.
  3902. * **Z Axis Limits:** The minimum and maximum limits the Interactable Object can be moved along the z axis.
  3903. * **Min Max Threshold:** The threshold the position value needs to be within to register a min or max position value.
  3904. * **Min Max Normalized Threshold:** The threshold the normalized position value needs to be within to register a min or max normalized position value.
  3905. ### Class Variables
  3906. * `public Vector3 localOrigin` - The default local position of the Interactable Object.
  3907. ### Class Events
  3908. * `TransformPositionChanged` - Emitted when the Transform position has changed.
  3909. * `XAxisMinLimitReached` - Emitted when the Transform position has reached the X Axis Min Limit.
  3910. * `XAxisMinLimitExited` - Emitted when the Transform position has exited the X Axis Min Limit.
  3911. * `XAxisMaxLimitReached` - Emitted when the Transform position has reached the X Axis Max Limit.
  3912. * `XAxisMaxLimitExited` - Emitted when the Transform position has exited the X Axis Max Limit.
  3913. * `YAxisMinLimitReached` - Emitted when the Transform position has reached the Y Axis Min Limit.
  3914. * `YAxisMinLimitExited` - Emitted when the Transform position has exited the Y Axis Min Limit.
  3915. * `YAxisMaxLimitReached` - Emitted when the Transform position has reached the Y Axis Max Limit.
  3916. * `YAxisMaxLimitExited` - Emitted when the Transform position has exited the Y Axis Max Limit.
  3917. * `ZAxisMinLimitReached` - Emitted when the Transform position has reached the Z Axis Min Limit.
  3918. * `ZAxisMinLimitExited` - Emitted when the Transform position has exited the Z Axis Min Limit.
  3919. * `ZAxisMaxLimitReached` - Emitted when the Transform position has reached the Z Axis Max Limit.
  3920. * `ZAxisMaxLimitExited` - Emitted when the Transform position has exited the Z Axis Max Limit.
  3921. ### Unity Events
  3922. Adding the `VRTK_MoveTransformGrabAttach_UnityEvents` component to `VRTK_MoveTransformGrabAttach` object allows access to `UnityEvents` that will react identically to the Class Events.
  3923. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  3924. ### Event Payload
  3925. * `GameObject interactingObject` - The GameObject that is performing the interaction (e.g. a controller).
  3926. * `Vector3 position` - The current position in relation to the axis limits from the origin position.
  3927. * `Vector3 normalizedPosition` - The normalized position (between `0f` and `1f`) of the Interactable Object in relation to the axis limits.
  3928. * `Vector3 currentDirection` - The direction vector that the Interactable Object is currently moving across the axes in.
  3929. * `Vector3 originDirection` - The direction vector that the Interactable Object is currently moving across the axes in in relation to the origin position.
  3930. ### Class Methods
  3931. #### StartGrab/3
  3932. > `public override bool StartGrab(GameObject grabbingObject, GameObject givenGrabbedObject, Rigidbody givenControllerAttachPoint)`
  3933. * Parameters
  3934. * `GameObject grabbingObject` - The GameObject that is doing the grabbing.
  3935. * `GameObject givenGrabbedObject` - The GameObject that is being grabbed.
  3936. * `Rigidbody givenControllerAttachPoint` - The point on the grabbing object that the grabbed object should be attached to after grab occurs.
  3937. * Returns
  3938. * `bool` - Returns `true` if the grab is successful, `false` if the grab is unsuccessful.
  3939. The StartGrab method sets up the grab attach mechanic as soon as an Interactable Object is grabbed.
  3940. #### StopGrab/1
  3941. > `public override void StopGrab(bool applyGrabbingObjectVelocity)`
  3942. * Parameters
  3943. * `bool applyGrabbingObjectVelocity` - If `true` will apply the current velocity of the grabbing object to the grabbed object on release.
  3944. * Returns
  3945. * _none_
  3946. The StopGrab method ends the grab of the current Interactable Object and cleans up the state.
  3947. #### CreateTrackPoint/4
  3948. > `public override Transform CreateTrackPoint(Transform controllerPoint, GameObject currentGrabbedObject, GameObject currentGrabbingObject, ref bool customTrackPoint)`
  3949. * Parameters
  3950. * `Transform controllerPoint` - The point on the controller where the grab was initiated.
  3951. * `GameObject currentGrabbedObject` - The GameObject that is currently being grabbed.
  3952. * `GameObject currentGrabbingObject` - The GameObject that is currently doing the grabbing.
  3953. * `ref bool customTrackPoint` - A reference to whether the created track point is an auto generated custom object.
  3954. * Returns
  3955. * `Transform` - The Transform of the created track point.
  3956. The CreateTrackPoint method sets up the point of grab to track on the grabbed object.
  3957. #### ProcessUpdate/0
  3958. > `public override void ProcessUpdate()`
  3959. * Parameters
  3960. * _none_
  3961. * Returns
  3962. * _none_
  3963. The ProcessUpdate method is run in every Update method on the Interactable Object.
  3964. #### GetPosition/0
  3965. > `public virtual Vector3 GetPosition()`
  3966. * Parameters
  3967. * _none_
  3968. * Returns
  3969. * `Vector3` - A Vector3 containing the current Transform position in relation to the axis limits.
  3970. The GetPosition method returns a Vector3 of the Transform position in relation to the axis limits.
  3971. #### GetNormalizedPosition/0
  3972. > `public virtual Vector3 GetNormalizedPosition()`
  3973. * Parameters
  3974. * _none_
  3975. * Returns
  3976. * `Vector3` - A normalized Vector3 of the Transform position in relation to the axis limits.
  3977. The GetNormalizedPosition method returns a Vector3 of the Transform position normalized between `0f` and `1f` in relation to the axis limits.;
  3978. #### GetCurrentDirection/0
  3979. > `public virtual Vector3 GetCurrentDirection()`
  3980. * Parameters
  3981. * _none_
  3982. * Returns
  3983. * `Vector3` - A Vector3 of the direction the Transform is moving across the relevant axis in.
  3984. The GetCurrentDirection method returns a Vector3 of the current positive/negative axis direction that the Transform is moving in.
  3985. #### GetDirectionFromOrigin/0
  3986. > `public virtual Vector3 GetDirectionFromOrigin()`
  3987. * Parameters
  3988. * _none_
  3989. * Returns
  3990. * `Vector3` - A Vector3 of the direction the Transform is moving across the relevant axis in relation to the original position.
  3991. The GetDirectionFromOrigin method returns a Vector3 of the direction across the axis from the original position.
  3992. #### SetCurrentPosition/2
  3993. > `public virtual void SetCurrentPosition(Vector3 newPosition, float speed)`
  3994. * Parameters
  3995. * `Vector3 newPosition` - The position to move the Interactable Object to.
  3996. * `float speed` - The speed in which to move the Interactable Object.
  3997. * Returns
  3998. * _none_
  3999. The SetCurrentPosition method sets the position of the Interactable Object to the given new position at the appropriate speed.
  4000. #### ResetPosition/0
  4001. > `public virtual void ResetPosition()`
  4002. * Parameters
  4003. * _none_
  4004. * Returns
  4005. * _none_
  4006. The ResetPosition method will move the Interactable Object back to the origin position.
  4007. #### GetWorldLimits/0
  4008. > `public virtual Limits2D[] GetWorldLimits()`
  4009. * Parameters
  4010. * _none_
  4011. * Returns
  4012. * `Limits2D[]` - An array of axis limits in world space.
  4013. The GetWorldLimits method returns an array of minimum and maximum axis limits for the Interactable Object in world space.
  4014. ---
  4015. ## Rotate Transform Grab Attach (VRTK_RotateTransformGrabAttach)
  4016. > extends [VRTK_BaseGrabAttach](#base-grab-attach-vrtk_basegrabattach)
  4017. ### Overview
  4018. Rotates the Transform of the Interactable Object around a specified transform local axis within the given limits.
  4019. > To allow unrestricted movement, set the angle limits minimum to `-infinity` and the angle limits maximum to `infinity`.
  4020. **Script Usage:**
  4021. * Place the `VRTK_RotateTransformGrabAttach` script on either:
  4022. * The GameObject of the Interactable Object to detect interactions on.
  4023. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Grab Attach Mechanic Script` parameter to denote use of the grab mechanic.
  4024. ### Inspector Parameters
  4025. * **Detach Distance:** The maximum distance the grabbing object is away from the Interactable Object before it is automatically dropped.
  4026. * **Origin Deadzone:** The distance between grabbing object and the centre of Interactable Object that is considered to be non grabbable. If the grabbing object is within the `Origin Deadzone` distance then it will be automatically ungrabbed.
  4027. * **Rotate Around:** The local axis in which to rotate the object around.
  4028. * **Rotation Action:** Determines how the rotation of the object is calculated based on the action of the grabbing object.
  4029. * **Rotation Friction:** The amount of friction to apply when rotating, simulates a tougher rotation.
  4030. * **Release Deceleration Damper:** The damper in which to slow the Interactable Object's rotation down when released to simulate continued momentum. The higher the number, the faster the Interactable Object will come to a complete stop on release.
  4031. * **Reset To Orign On Release Speed:** The speed in which the Interactable Object returns to it's origin rotation when released. If the `Reset To Orign On Release Speed` is `0f` then the rotation will not be reset.
  4032. * **Angle Limits:** The negative and positive limits the axis can be rotated to.
  4033. * **Min Max Threshold:** The threshold the rotation value needs to be within to register a min or max rotation value.
  4034. * **Min Max Normalized Threshold:** The threshold the normalized rotation value needs to be within to register a min or max normalized rotation value.
  4035. ### Class Variables
  4036. * `public enum RotationAxis` - The local axis for rotation.
  4037. * `xAxis` - The local X Axis of the transform.
  4038. * `yAxis` - The local Y Axis of the transform.
  4039. * `zAxis` - The local Z Axis of the transform.
  4040. * `public enum RotationType` - The way in which rotation from the grabbing object is applied.
  4041. * `FollowAttachPoint` - The angle between the Interactable Object origin and the grabbing object attach point.
  4042. * `FollowLongitudinalAxis` - The angular velocity across the grabbing object's longitudinal axis (the roll axis).
  4043. * `FollowLateralAxis` - The angular velocity across the grabbing object's lateral axis (the pitch axis).
  4044. * `FollowPerpendicularAxis` - The angular velocity across the grabbing object's perpendicular axis (the yaw axis).
  4045. * `public Quaternion originRotation` - The default local rotation of the Interactable Object.
  4046. ### Class Events
  4047. * `AngleChanged` - Emitted when the angle changes.
  4048. * `MinAngleReached` - Emitted when the angle reaches the minimum angle.
  4049. * `MinAngleExited` - Emitted when the angle exits the minimum angle state.
  4050. * `MaxAngleReached` - Emitted when the angle reaches the maximum angle.
  4051. * `MaxAngleExited` - Emitted when the angle exits the maximum angle state.
  4052. ### Unity Events
  4053. Adding the `VRTK_RotateTransformGrabAttach_UnityEvents` component to `VRTK_RotateTransformGrabAttach` object allows access to `UnityEvents` that will react identically to the Class Events.
  4054. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  4055. ### Event Payload
  4056. * `GameObject interactingObject` - The GameObject that is performing the interaction (e.g. a controller).
  4057. * `float currentAngle` - The current angle the Interactable Object is rotated to.
  4058. * `float normalizedAngle` - The normalized angle (between `0f` and `1f`) the Interactable Object is rotated to.
  4059. * `Vector3 rotationSpeed` - The speed in which the rotation is occuring.
  4060. ### Class Methods
  4061. #### StartGrab/3
  4062. > `public override bool StartGrab(GameObject grabbingObject, GameObject givenGrabbedObject, Rigidbody givenControllerAttachPoint)`
  4063. * Parameters
  4064. * `GameObject grabbingObject` - The GameObject that is doing the grabbing.
  4065. * `GameObject givenGrabbedObject` - The GameObject that is being grabbed.
  4066. * `Rigidbody givenControllerAttachPoint` - The point on the grabbing object that the grabbed object should be attached to after grab occurs.
  4067. * Returns
  4068. * `bool` - Returns `true` if the grab is successful, `false` if the grab is unsuccessful.
  4069. The StartGrab method sets up the grab attach mechanic as soon as an Interactable Object is grabbed.
  4070. #### StopGrab/1
  4071. > `public override void StopGrab(bool applyGrabbingObjectVelocity)`
  4072. * Parameters
  4073. * `bool applyGrabbingObjectVelocity` - If `true` will apply the current velocity of the grabbing object to the grabbed object on release.
  4074. * Returns
  4075. * _none_
  4076. The StopGrab method ends the grab of the current Interactable Object and cleans up the state.
  4077. #### ProcessUpdate/0
  4078. > `public override void ProcessUpdate()`
  4079. * Parameters
  4080. * _none_
  4081. * Returns
  4082. * _none_
  4083. The ProcessUpdate method is run in every Update method on the Interactable Object.
  4084. #### SetRotation/2
  4085. > `public virtual void SetRotation(float newAngle, float transitionTime = 0f)`
  4086. * Parameters
  4087. * `float newAngle` - The angle to rotate to through the current rotation axis.
  4088. * `float transitionTime` - The time in which the entire rotation operation will take place.
  4089. * Returns
  4090. * _none_
  4091. The SetRotation method sets the rotation on the Interactable Object to the given angle over the desired time.
  4092. #### ResetRotation/1
  4093. > `public virtual void ResetRotation(bool ignoreTransition = false)`
  4094. * Parameters
  4095. * `bool ignoreTransition` - If this is `true` then the `Reset To Origin On Release Speed` will be ignored and the reset will occur instantly.
  4096. * Returns
  4097. * _none_
  4098. The ResetRotation method will rotate the Interactable Object back to the origin rotation.
  4099. #### GetAngle/0
  4100. > `public virtual float GetAngle()`
  4101. * Parameters
  4102. * _none_
  4103. * Returns
  4104. * `float` - The current rotated angle.
  4105. The GetAngle method returns the current angle the Interactable Object is rotated to.
  4106. #### GetNormalizedAngle/0
  4107. > `public virtual float GetNormalizedAngle()`
  4108. * Parameters
  4109. * _none_
  4110. * Returns
  4111. * `float` - The normalized rotated angle. Will return `0f` if either limit is set to `infinity`.
  4112. The GetNormalizedAngle returns the normalized current angle between the minimum and maximum angle limits.
  4113. #### GetRotationSpeed/0
  4114. > `public virtual Vector3 GetRotationSpeed()`
  4115. * Parameters
  4116. * _none_
  4117. * Returns
  4118. * `Vector3` - A Vector3 containing the speed each axis is rotating in.
  4119. The GetRotationSpeed returns the current speed in which the Interactable Object is rotating.
  4120. ---
  4121. # Secondary Controller Grab Actions (VRTK/Source/Scripts/Interactions/SecondaryControllerGrabActions)
  4122. A collection of scripts that are used to provide different actions when a secondary controller grabs a grabbed object.
  4123. * [Base Grab Action](#base-grab-action-vrtk_basegrabaction)
  4124. * [Swap Controller Grab Action](#swap-controller-grab-action-vrtk_swapcontrollergrabaction)
  4125. * [Axis Scale Grab Action](#axis-scale-grab-action-vrtk_axisscalegrabaction)
  4126. * [Control Direction Grab Action](#control-direction-grab-action-vrtk_controldirectiongrabaction)
  4127. ---
  4128. ## Base Grab Action (VRTK_BaseGrabAction)
  4129. ### Overview
  4130. Provides a base that all secondary controller grab attach can inherit from.
  4131. **Script Usage:**
  4132. > This is an abstract class that is to be inherited to a concrete class that provides secondary controller grab action functionality, therefore this script should not be directly used.
  4133. ### Class Methods
  4134. #### Initialise/5
  4135. > `public virtual void Initialise(VRTK_InteractableObject currentGrabbdObject, VRTK_InteractGrab currentPrimaryGrabbingObject, VRTK_InteractGrab currentSecondaryGrabbingObject, Transform primaryGrabPoint, Transform secondaryGrabPoint)`
  4136. * Parameters
  4137. * `VRTK_InteractableObject currentGrabbdObject` - The Interactable Object script for the object currently being grabbed by the primary grabbing object.
  4138. * `VRTK_InteractGrab currentPrimaryGrabbingObject` - The Interact Grab script for the object that is associated with the primary grabbing object.
  4139. * `VRTK_InteractGrab currentSecondaryGrabbingObject` - The Interact Grab script for the object that is associated with the secondary grabbing object.
  4140. * `Transform primaryGrabPoint` - The point on the Interactable Object where the primary Interact Grab initially grabbed the Interactable Object.
  4141. * `Transform secondaryGrabPoint` - The point on the Interactable Object where the secondary Interact Grab initially grabbed the Interactable Object.
  4142. * Returns
  4143. * _none_
  4144. The Initalise method is used to set up the state of the secondary action when the Interactable Object is initially grabbed by a secondary Interact Grab.
  4145. #### ResetAction/0
  4146. > `public virtual void ResetAction()`
  4147. * Parameters
  4148. * _none_
  4149. * Returns
  4150. * _none_
  4151. The ResetAction method is used to reset the secondary action when the Interactable Object is no longer grabbed by a secondary Interact Grab.
  4152. #### IsActionable/0
  4153. > `public virtual bool IsActionable()`
  4154. * Parameters
  4155. * _none_
  4156. * Returns
  4157. * `bool` - Returns `true` if the secondary grab action does perform an action on secondary grab.
  4158. The IsActionable method is used to determine if the secondary grab action performs an action on grab.
  4159. #### IsSwappable/0
  4160. > `public virtual bool IsSwappable()`
  4161. * Parameters
  4162. * _none_
  4163. * Returns
  4164. * `bool` - Returns `true` if the grab action allows swapping to another grabbing object.
  4165. The IsSwappable method is used to determine if the secondary grab action allows to swab the grab state to another grabbing Interactable Object.
  4166. #### ProcessUpdate/0
  4167. > `public virtual void ProcessUpdate()`
  4168. * Parameters
  4169. * _none_
  4170. * Returns
  4171. * _none_
  4172. The ProcessUpdate method runs in every Update on the Interactable Object whilst it is being grabbed by a secondary Interact Grab.
  4173. #### ProcessFixedUpdate/0
  4174. > `public virtual void ProcessFixedUpdate()`
  4175. * Parameters
  4176. * _none_
  4177. * Returns
  4178. * _none_
  4179. The ProcessFixedUpdate method runs in every FixedUpdate on the Interactable Object whilst it is being grabbed by a secondary Interact Grab.
  4180. #### OnDropAction/0
  4181. > `public virtual void OnDropAction()`
  4182. * Parameters
  4183. * _none_
  4184. * Returns
  4185. * _none_
  4186. The OnDropAction method is executed when the current grabbed Interactable Object is dropped and can be used up to clean up any secondary grab actions.
  4187. ---
  4188. ## Swap Controller Grab Action (VRTK_SwapControllerGrabAction)
  4189. > extends [VRTK_BaseGrabAction](#base-grab-action-vrtk_basegrabaction)
  4190. ### Overview
  4191. Swaps the grabbed Interactable Object to the new grabbing object.
  4192. **Script Usage:**
  4193. * Place the `VRTK_SwapControllerGrabAction` script on either:
  4194. * The GameObject of the Interactable Object to detect interactions on.
  4195. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Secondary Grab Action Script` parameter to denote use of the secondary grab action.
  4196. ### Example
  4197. `VRTK/Examples/005_Controller_BasicObjectGrabbing` demonstrates the ability to swap objects between controllers on grab.
  4198. ---
  4199. ## Axis Scale Grab Action (VRTK_AxisScaleGrabAction)
  4200. > extends [VRTK_BaseGrabAction](#base-grab-action-vrtk_basegrabaction)
  4201. ### Overview
  4202. Scales the grabbed Interactable Object along the given axes based on the position of the secondary grabbing Interact Grab.
  4203. **Script Usage:**
  4204. * Place the `VRTK_AxisScaleGrabAction` script on either:
  4205. * The GameObject of the Interactable Object to detect interactions on.
  4206. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Secondary Grab Action Script` parameter to denote use of the secondary grab action.
  4207. ### Inspector Parameters
  4208. * **Ungrab Distance:** The distance the secondary grabbing object must move away from the original grab position before the secondary grabbing object auto ungrabs the Interactable Object.
  4209. * **Lock Axis:** Locks the specified checked axes so they won't be scaled
  4210. * **Uniform Scaling:** If checked all the axes will be scaled together (unless locked)
  4211. ### Class Methods
  4212. #### Initialise/5
  4213. > `public override void Initialise(VRTK_InteractableObject currentGrabbdObject, VRTK_InteractGrab currentPrimaryGrabbingObject, VRTK_InteractGrab currentSecondaryGrabbingObject, Transform primaryGrabPoint, Transform secondaryGrabPoint)`
  4214. * Parameters
  4215. * `VRTK_InteractableObject currentGrabbdObject` - The Interactable Object script for the object currently being grabbed by the primary grabbing object.
  4216. * `VRTK_InteractGrab currentPrimaryGrabbingObject` - The Interact Grab script for the object that is associated with the primary grabbing object.
  4217. * `VRTK_InteractGrab currentSecondaryGrabbingObject` - The Interact Grab script for the object that is associated with the secondary grabbing object.
  4218. * `Transform primaryGrabPoint` - The point on the Interactable Object where the primary Interact Grab initially grabbed the Interactable Object.
  4219. * `Transform secondaryGrabPoint` - The point on the Interactable Object where the secondary Interact Grab initially grabbed the Interactable Object.
  4220. * Returns
  4221. * _none_
  4222. The Initalise method is used to set up the state of the secondary action when the Interactable Object is initially grabbed by a secondary Interact Grab.
  4223. #### ProcessUpdate/0
  4224. > `public override void ProcessUpdate()`
  4225. * Parameters
  4226. * _none_
  4227. * Returns
  4228. * _none_
  4229. The ProcessUpdate method runs in every Update on the Interactable Object whilst it is being grabbed by a secondary Interact Grab.
  4230. #### ProcessFixedUpdate/0
  4231. > `public override void ProcessFixedUpdate()`
  4232. * Parameters
  4233. * _none_
  4234. * Returns
  4235. * _none_
  4236. The ProcessFixedUpdate method runs in every FixedUpdate on the Interactable Object whilst it is being grabbed by a secondary Interact Grab and performs the scaling action.
  4237. ### Example
  4238. `VRTK/Examples/043_Controller_SecondaryControllerActions` demonstrates the ability to grab an object with one controller and scale it by grabbing and pulling with the second controller.
  4239. ---
  4240. ## Control Direction Grab Action (VRTK_ControlDirectionGrabAction)
  4241. > extends [VRTK_BaseGrabAction](#base-grab-action-vrtk_basegrabaction)
  4242. ### Overview
  4243. Controls the facing direction of the grabbed Interactable Object to rotate in the direction of the secondary grabbing object.
  4244. > Rotation will only occur correctly if the Interactable Object `forward` is correctly aligned to the world `z-axis` and the `up` is correctly aligned to the world `y-axis`. It is also not possible to control the direction of an Interactable Object that uses the Joint based grab mechanics.
  4245. **Script Usage:**
  4246. * Place the `VRTK_ControlDirectionGrabAction` script on either:
  4247. * The GameObject of the Interactable Object to detect interactions on.
  4248. * Any other scene GameObject and then link that GameObject to the Interactable Objects `Secondary Grab Action Script` parameter to denote use of the secondary grab action.
  4249. ### Inspector Parameters
  4250. * **Ungrab Distance:** The distance the secondary controller must move away from the original grab position before the secondary controller auto ungrabs the object.
  4251. * **Release Snap Speed:** The speed in which the object will snap back to it's original rotation when the secondary controller stops grabbing it. `0` for instant snap, `infinity` for no snap back.
  4252. * **Lock Z Rotation:** Prevent the secondary controller rotating the grabbed object through it's z-axis.
  4253. ### Class Methods
  4254. #### Initialise/5
  4255. > `public override void Initialise(VRTK_InteractableObject currentGrabbdObject, VRTK_InteractGrab currentPrimaryGrabbingObject, VRTK_InteractGrab currentSecondaryGrabbingObject, Transform primaryGrabPoint, Transform secondaryGrabPoint)`
  4256. * Parameters
  4257. * `VRTK_InteractableObject currentGrabbdObject` - The Interactable Object script for the object currently being grabbed by the primary grabbing object.
  4258. * `VRTK_InteractGrab currentPrimaryGrabbingObject` - The Interact Grab script for the object that is associated with the primary grabbing object.
  4259. * `VRTK_InteractGrab currentSecondaryGrabbingObject` - The Interact Grab script for the object that is associated with the secondary grabbing object.
  4260. * `Transform primaryGrabPoint` - The point on the Interactable Object where the primary Interact Grab initially grabbed the Interactable Object.
  4261. * `Transform secondaryGrabPoint` - The point on the Interactable Object where the secondary Interact Grab initially grabbed the Interactable Object.
  4262. * Returns
  4263. * _none_
  4264. The Initalise method is used to set up the state of the secondary action when the object is initially grabbed by a secondary controller.
  4265. #### ResetAction/0
  4266. > `public override void ResetAction()`
  4267. * Parameters
  4268. * _none_
  4269. * Returns
  4270. * _none_
  4271. The ResetAction method is used to reset the secondary action when the Interactable Object is no longer grabbed by a secondary Interact Grab.
  4272. #### OnDropAction/0
  4273. > `public override void OnDropAction()`
  4274. * Parameters
  4275. * _none_
  4276. * Returns
  4277. * _none_
  4278. The OnDropAction method is executed when the current grabbed Interactable Object is dropped and can be used up to clean up any secondary grab actions.
  4279. #### ProcessUpdate/0
  4280. > `public override void ProcessUpdate()`
  4281. * Parameters
  4282. * _none_
  4283. * Returns
  4284. * _none_
  4285. The ProcessUpdate method runs in every Update on the Interactable Object whilst it is being grabbed by a secondary Interact Grab.
  4286. #### ProcessFixedUpdate/0
  4287. > `public override void ProcessFixedUpdate()`
  4288. * Parameters
  4289. * _none_
  4290. * Returns
  4291. * _none_
  4292. The ProcessFixedUpdate method runs in every FixedUpdate on the Interactable Object whilst it is being grabbed by a secondary Interact Grab and influences the rotation of the Interactable Object.
  4293. ### Example
  4294. `VRTK/Examples/043_Controller_SecondaryControllerActions` demonstrates the ability to grab an object with one controller and control their direction with the second controller.
  4295. ---
  4296. # Controllables (VRTK/Source/Scripts/Interactions/Controllables)
  4297. Contains scripts that form the basis of interactable 3D controls that are either Physics based or artificially simulated.
  4298. * [Base Controllable](#base-controllable-vrtk_basecontrollable)
  4299. ---
  4300. ## Base Controllable (VRTK_BaseControllable)
  4301. ### Overview
  4302. Provides a base that all Controllables can inherit from.
  4303. **Script Usage:**
  4304. > This is an abstract class that is to be inherited to a concrete class that provides controllable functionality, therefore this script should not be directly used.
  4305. ### Inspector Parameters
  4306. * **Operate Axis:** The local axis in which the Controllable will operate through.
  4307. * **Ignore Collisions With:** A collection of GameObjects to ignore collision events with.
  4308. * **Exclude Collider Check On:** A collection of GameObjects to exclude when determining if a default collider should be created.
  4309. * **Equality Fidelity:** The amount of fidelity when comparing the position of the control with the previous position. Determines if it's equal above a certain decimal place threshold.
  4310. ### Class Variables
  4311. * `public enum OperatingAxis` - The local axis that the Controllable will be operated through.
  4312. * `xAxis` - The local x axis.
  4313. * `yAxis` - The local y axis.
  4314. * `zAxis` - The local z axis.
  4315. ### Class Events
  4316. * `ValueChanged` - Emitted when the Controllable value has changed.
  4317. * `RestingPointReached` - Emitted when the Controllable value has reached the resting point.
  4318. * `MinLimitReached` - Emitted when the Controllable value has reached the minimum limit.
  4319. * `MinLimitExited` - Emitted when the Controllable value has exited the minimum limit.
  4320. * `MaxLimitReached` - Emitted when the Controllable value has reached the maximum limit.
  4321. * `MaxLimitExited` - Emitted when the Controllable value has exited the maximum limit.
  4322. ### Unity Events
  4323. Adding the `VRTK_BaseControllable_UnityEvents` component to `VRTK_BaseControllable` object allows access to `UnityEvents` that will react identically to the Class Events.
  4324. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  4325. ### Event Payload
  4326. * `Collider interactingCollider` - The Collider that is initiating the interaction.
  4327. * `VRTK_InteractTouch interactingTouchScript` - The optional Interact Touch script that is initiating the interaction.
  4328. * `float value` - The current value being reported by the controllable.
  4329. * `float normalizedValue` - The normalized value being reported by the controllable.
  4330. ### Class Methods
  4331. #### AtMinLimit/0
  4332. > `public virtual bool AtMinLimit()`
  4333. * Parameters
  4334. * _none_
  4335. * Returns
  4336. * `bool` - Returns `true` if the Controllable is at it's minimum limit.
  4337. The AtMinLimit method returns whether the Controllable is currently at it's minimum limit.
  4338. #### AtMaxLimit/0
  4339. > `public virtual bool AtMaxLimit()`
  4340. * Parameters
  4341. * _none_
  4342. * Returns
  4343. * `bool` - Returns `true` if the Controllable is at it's maximum limit.
  4344. The AtMaxLimit method returns whether the Controllable is currently at it's maximum limit.
  4345. #### GetOriginalLocalPosition/0
  4346. > `public virtual Vector3 GetOriginalLocalPosition()`
  4347. * Parameters
  4348. * _none_
  4349. * Returns
  4350. * `Vector3` - A Vector3 of the original local position.
  4351. The GetOriginalLocalPosition method returns the original local position of the control.
  4352. #### GetOriginalLocalRotation/0
  4353. > `public virtual Quaternion GetOriginalLocalRotation()`
  4354. * Parameters
  4355. * _none_
  4356. * Returns
  4357. * `Quaternion` - A quaternion of the original local rotation.
  4358. The GetOriginalLocalRotation method returns the original local rotation of the control.
  4359. #### GetControlColliders/0
  4360. > `public virtual Collider[] GetControlColliders()`
  4361. * Parameters
  4362. * _none_
  4363. * Returns
  4364. * `Collider[]` - The Colliders array associated with the control.
  4365. The GetControlColliders method returns the Colliders array associated with the control.
  4366. #### GetInteractingCollider/0
  4367. > `public virtual Collider GetInteractingCollider()`
  4368. * Parameters
  4369. * _none_
  4370. * Returns
  4371. * `Collider` - The Collider currently interacting with the control.
  4372. The GetInteractingCollider method returns the Collider of the GameObject currently interacting with the control.
  4373. #### GetInteractingTouch/0
  4374. > `public virtual VRTK_InteractTouch GetInteractingTouch()`
  4375. * Parameters
  4376. * _none_
  4377. * Returns
  4378. * `VRTK_InteractTouch` - The Interact Touch script currently interacting with the control.
  4379. The GetInteractingTouch method returns the Interact Touch script of the GameObject currently interacting with the control.
  4380. ---
  4381. # Physics Controllables (VRTK/Source/Scripts/Interactions/Controllables/Physics)
  4382. A collection of scripts that provide physics based controls that mimiic real life objects.
  4383. * [Base Physics Controllable](#base-physics-controllable-vrtk_basephysicscontrollable)
  4384. * [Physics Pusher](#physics-pusher-vrtk_physicspusher)
  4385. * [Physics Rotator](#physics-rotator-vrtk_physicsrotator)
  4386. * [Physics Slider](#physics-slider-vrtk_physicsslider)
  4387. ---
  4388. ## Base Physics Controllable (VRTK_BasePhysicsControllable)
  4389. > extends [VRTK_BaseControllable](#base-controllable-vrtk_basecontrollable)
  4390. ### Overview
  4391. Provides a base that all physics based Controllables can inherit from.
  4392. **Script Usage:**
  4393. > This is an abstract class that is to be inherited to a concrete class that provides physics based controllable functionality, therefore this script should not be directly used.
  4394. ### Inspector Parameters
  4395. * **Connected To:** The Rigidbody that the Controllable is connected to.
  4396. ### Class Methods
  4397. #### GetControlRigidbody/0
  4398. > `public virtual Rigidbody GetControlRigidbody()`
  4399. * Parameters
  4400. * _none_
  4401. * Returns
  4402. * `Rigidbody` - The Rigidbody associated with the control.
  4403. The GetControlRigidbody method returns the rigidbody associated with the control.
  4404. #### GetControlActivatorContainer/0
  4405. > `public virtual GameObject GetControlActivatorContainer()`
  4406. * Parameters
  4407. * _none_
  4408. * Returns
  4409. * `GameObject` - The GameObject that contains the Controller Rigidbody Activator associated with the control.
  4410. The GetControlActivatorContainer method returns the GameObject that contains the Controller Rigidbody Activator associated with the control.
  4411. ---
  4412. ## Physics Pusher (VRTK_PhysicsPusher)
  4413. > extends [VRTK_BasePhysicsControllable](#base-physics-controllable-vrtk_basephysicscontrollable)
  4414. ### Overview
  4415. A physics based pushable pusher.
  4416. **Required Components:**
  4417. * `Collider` - A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects. Will be automatically added at runtime.
  4418. * `Rigidbody` - A Unity Rigidbody to allow the GameObject to be affected by the Unity Physics System. Will be automatically added at runtime.
  4419. **Optional Components:**
  4420. * `VRTK_ControllerRigidbodyActivator` - A Controller Rigidbody Activator to automatically enable the controller rigidbody upon touching the pusher.
  4421. **Script Usage:**
  4422. * Create a pusher container GameObject and set the GameObject that is to become the pusher as a child of the newly created container GameObject.
  4423. * Place the `VRTK_PhysicsPusher` script onto the GameObject that is to become the pusher.
  4424. > The Physics Pusher script must not be on a root level GameObject. Any runtime world positioning of the pusher must be set on the parent container GameObject.
  4425. ### Inspector Parameters
  4426. * **Pressed Distance:** The local space distance along the `Operate Axis` until the pusher reaches the pressed position.
  4427. * **Stay Pressed:** If this is checked then the pusher will stay in the pressed position when it reaches the maximum position.
  4428. * **Min Max Limit Threshold:** The threshold in which the pusher's current normalized position along the `Operate Axis` has to be within the minimum and maximum limits of the pusher.
  4429. * **Resting Position:** The normalized position of the pusher between the original position and the pressed position that will be considered as the resting position for the pusher.
  4430. * **Resting Position Threshold:** The normalized value that the pusher can be from the `Resting Position` before the pusher is considered to be resting when not being interacted with.
  4431. * **Position Target:** The normalized position of the pusher between the original position and the pressed position. `0f` will set the pusher position to the original position, `1f` will set the pusher position to the pressed position.
  4432. * **Target Force:** The amount of force to apply to push the pusher towards the intended target position.
  4433. ### Class Methods
  4434. #### GetValue/0
  4435. > `public override float GetValue()`
  4436. * Parameters
  4437. * _none_
  4438. * Returns
  4439. * `float` - The actual position of the pusher.
  4440. The GetValue method returns the current position value of the pusher.
  4441. #### GetNormalizedValue/0
  4442. > `public override float GetNormalizedValue()`
  4443. * Parameters
  4444. * _none_
  4445. * Returns
  4446. * `float` - The normalized position of the pusher.
  4447. The GetNormalizedValue method returns the current position value of the pusher normalized between `0f` and `1f`.
  4448. #### SetValue/1
  4449. > `public override void SetValue(float value)`
  4450. * Parameters
  4451. * `float value` - Not used.
  4452. * Returns
  4453. * _none_
  4454. The SetValue method is not implemented as the pusher resets automatically.
  4455. #### IsResting/0
  4456. > `public override bool IsResting()`
  4457. * Parameters
  4458. * _none_
  4459. * Returns
  4460. * `bool` - Returns `true` if the pusher is currently at the resting position.
  4461. The IsResting method returns whether the pusher is currently at it's resting position.
  4462. #### GetControlJoint/0
  4463. > `public virtual ConfigurableJoint GetControlJoint()`
  4464. * Parameters
  4465. * _none_
  4466. * Returns
  4467. * `ConfigurableJoint` - The joint associated with the control.
  4468. The GetControlJoint method returns the joint associated with the control.
  4469. ---
  4470. ## Physics Rotator (VRTK_PhysicsRotator)
  4471. > extends [VRTK_BasePhysicsControllable](#base-physics-controllable-vrtk_basephysicscontrollable)
  4472. ### Overview
  4473. A physics based rotatable object.
  4474. **Required Components:**
  4475. * `Collider` - A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects. Will be automatically added at runtime.
  4476. * `Rigidbody` - A Unity Rigidbody to allow the GameObject to be affected by the Unity Physics System. Will be automatically added at runtime.
  4477. **Optional Components:**
  4478. * `VRTK_ControllerRigidbodyActivator` - A Controller Rigidbody Activator to automatically enable the controller rigidbody when near the rotator.
  4479. **Script Usage:**
  4480. * Create a rotator container GameObject and set the GameObject that is to become the rotator as a child of the newly created container GameObject.
  4481. * Place the `VRTK_PhysicsRotator` script onto the GameObject that is to become the rotatable object and ensure the Transform rotation is `0, 0, 0`.
  4482. * Create a nested GameObject under the rotator GameObject and position it where the hinge should operate.
  4483. * Apply the nested hinge GameObject to the `Hinge Point` parameter on the Physics Rotator script.
  4484. > The rotator GameObject must not be at the root level and needs to have the Transform rotation set to `0,0,0`. This is the reason for the container GameObject requirement. Any positioning of the rotator must be set on the parent container GameObject.
  4485. ### Inspector Parameters
  4486. * **Hinge Point:** A Transform that denotes the position where the rotator hinge will be created.
  4487. * **Angle Limits:** The minimum and maximum angle the rotator can rotate to.
  4488. * **Min Max Threshold Angle:** The angle at which the rotator rotation can be within the minimum or maximum angle before the minimum or maximum angles are considered reached.
  4489. * **Resting Angle:** The angle at which will be considered as the resting position of the rotator.
  4490. * **Force Resting Angle Threshold:** The threshold angle from the `Resting Angle` that the current angle of the rotator needs to be within to snap the rotator back to the `Resting Angle`.
  4491. * **Angle Target:** The target angle to rotate the rotator to.
  4492. * **Is Locked:** If this is checked then the rotator Rigidbody will have all rotations frozen.
  4493. * **Step Value Range:** The minimum and the maximum step values for the rotator to register along the `Operate Axis`.
  4494. * **Step Size:** The increments the rotator value will change in between the `Step Value Range`.
  4495. * **Use Step As Value:** If this is checked then the value for the rotator will be the step value and not the absolute rotation of the rotator Transform.
  4496. * **Snap To Step:** If this is checked then the rotator will snap to the angle of the nearest step along the value range.
  4497. * **Snap Force:** The speed in which the rotator will snap to the relevant angle along the `Operate Axis`
  4498. * **Grab Mechanic:** The type of Interactable Object grab mechanic to use when operating the rotator.
  4499. * **Precision Grab:** If this is checked then when the Interact Grab grabs the Interactable Object, it will grab it with precision and pick it up at the particular point on the Interactable Object that the Interact Touch is touching.
  4500. * **Detach Distance:** The maximum distance the grabbing object is away from the rotator before it is automatically released.
  4501. * **Use Friction Overrides:** If this is checked then the `Grabbed Friction` value will be used as the Rigidbody drag value when the rotator is grabbed and the `Released Friction` value will be used as the Rigidbody drag value when the door is released.
  4502. * **Grabbed Friction:** The Rigidbody drag value when the rotator is grabbed.
  4503. * **Released Friction:** The Rigidbody drag value when the rotator is released.
  4504. * **Only Interact With:** A collection of GameObjects that will be used as the valid collisions to determine if the rotator can be interacted with.
  4505. ### Class Variables
  4506. * `public enum GrabMechanic` - Type of Grab Mechanic
  4507. * `TrackObject` - The Track Object Grab Mechanic
  4508. * `RotatorTrack` - The Rotator Track Grab Mechanic
  4509. ### Class Methods
  4510. #### GetValue/0
  4511. > `public override float GetValue()`
  4512. * Parameters
  4513. * _none_
  4514. * Returns
  4515. * `float` - The actual rotation of the rotator.
  4516. The GetValue method returns the current rotation value of the rotator.
  4517. #### GetNormalizedValue/0
  4518. > `public override float GetNormalizedValue()`
  4519. * Parameters
  4520. * _none_
  4521. * Returns
  4522. * `float` - The normalized rotation of the rotator.
  4523. The GetNormalizedValue method returns the current rotation value of the rotator normalized between `0f` and `1f`.
  4524. #### SetValue/1
  4525. > `public override void SetValue(float value)`
  4526. * Parameters
  4527. * `float value` - The new rotation value
  4528. * Returns
  4529. * _none_
  4530. The SetValue method sets the current Angle of the rotator
  4531. #### GetStepValue/1
  4532. > `public virtual float GetStepValue(float currentValue)`
  4533. * Parameters
  4534. * `float currentValue` - The current angle value of the rotator to get the Step Value for.
  4535. * Returns
  4536. * `float` - The current Step Value based on the rotator angle.
  4537. The GetStepValue method returns the current angle of the rotator based on the step value range.
  4538. #### SetAngleTargetWithStepValue/1
  4539. > `public virtual void SetAngleTargetWithStepValue(float givenStepValue)`
  4540. * Parameters
  4541. * `float givenStepValue` - The step value within the `Step Value Range` to set the `Angle Target` parameter to.
  4542. * Returns
  4543. * _none_
  4544. The SetAngleTargetWithStepValue sets the `Angle Target` parameter but uses a value within the `Step Value Range`.
  4545. #### SetRestingAngleWithStepValue/1
  4546. > `public virtual void SetRestingAngleWithStepValue(float givenStepValue)`
  4547. * Parameters
  4548. * `float givenStepValue` - The step value within the `Step Value Range` to set the `Resting Angle` parameter to.
  4549. * Returns
  4550. * _none_
  4551. The SetRestingAngleWithStepValue sets the `Resting Angle` parameter but uses a value within the `Step Value Range`.
  4552. #### GetAngleFromStepValue/1
  4553. > `public virtual float GetAngleFromStepValue(float givenStepValue)`
  4554. * Parameters
  4555. * `float givenStepValue` - The step value to check the angle for.
  4556. * Returns
  4557. * `float` - The angle the rotator would be at based on the given step value.
  4558. The GetAngleFromStepValue returns the angle the rotator would be at based on the given step value.
  4559. #### IsResting/0
  4560. > `public override bool IsResting()`
  4561. * Parameters
  4562. * _none_
  4563. * Returns
  4564. * `bool` - Returns `true` if the rotator is at the resting angle or within the resting angle threshold.
  4565. The IsResting method returns whether the rotator is at the resting angle or within the resting angle threshold.
  4566. #### GetControlJoint/0
  4567. > `public virtual HingeJoint GetControlJoint()`
  4568. * Parameters
  4569. * _none_
  4570. * Returns
  4571. * `HingeJoint` - The joint associated with the control.
  4572. The GetControlJoint method returns the joint associated with the control.
  4573. #### GetControlInteractableObject/0
  4574. > `public virtual VRTK_InteractableObject GetControlInteractableObject()`
  4575. * Parameters
  4576. * _none_
  4577. * Returns
  4578. * `VRTK_InteractableObject` - The Interactable Object associated with the control.
  4579. The GetControlInteractableObject method returns the Interactable Object associated with the control.
  4580. ---
  4581. ## Physics Slider (VRTK_PhysicsSlider)
  4582. > extends [VRTK_BasePhysicsControllable](#base-physics-controllable-vrtk_basephysicscontrollable)
  4583. ### Overview
  4584. A physics based slider.
  4585. **Required Components:**
  4586. * `Collider` - A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects. Will be automatically added at runtime.
  4587. * `Rigidbody` - A Unity Rigidbody to allow the GameObject to be affected by the Unity Physics System. Will be automatically added at runtime.
  4588. **Optional Components:**
  4589. * `VRTK_ControllerRigidbodyActivator` - A Controller Rigidbody Activator to automatically enable the controller rigidbody when near the slider.
  4590. **Script Usage:**
  4591. * Create a slider container GameObject and set the GameObject that is to become the slider as a child of the container.
  4592. * Place the `VRTK_PhysicsSlider` script onto the GameObject that is to become the slider.
  4593. > The slider GameObject must not be at the root level and needs to have it's Transform position set to `0,0,0`. This is the reason for the container GameObject requirement. Any positioning of the slider must be set on the parent GameObject.
  4594. ### Inspector Parameters
  4595. * **Maximum Length:** The maximum length that the slider can be moved from the origin position across the `Operate Axis`. A negative value will allow it to move the opposite way.
  4596. * **Min Max Threshold:** The normalized position the slider can be within the minimum or maximum slider positions before the minimum or maximum positions are considered reached.
  4597. * **Position Target:** The target position to move the slider towards given in a normalized value of `0f` (start point) to `1f` (end point).
  4598. * **Resting Position:** The position the slider when it is at the default resting point given in a normalized value of `0f` (start point) to `1f` (end point).
  4599. * **Force Resting Position Threshold:** The normalized threshold value the slider has to be within the `Resting Position` before the slider is forced back to the `Resting Position` if it is not grabbed.
  4600. * **Step Value Range:** The minimum and the maximum step values for the slider to register along the `Operate Axis`.
  4601. * **Step Size:** The increments the slider value will change in between the `Step Value Range`.
  4602. * **Use Step As Value:** If this is checked then the value for the slider will be the step value and not the absolute position of the slider Transform.
  4603. * **Snap To Step:** If this is checked then the slider will snap to the position of the nearest step along the value range.
  4604. * **Snap Force:** The speed in which the slider will snap to the relevant point along the `Operate Axis`
  4605. * **Precision Grab:** If this is checked then when the Interact Grab grabs the Interactable Object, it will grab it with precision and pick it up at the particular point on the Interactable Object that the Interact Touch is touching.
  4606. * **Detach Distance:** The maximum distance the grabbing object is away from the slider before it is automatically released.
  4607. * **Release Friction:** The amount of friction to the slider Rigidbody when it is released.
  4608. * **Only Interact With:** A collection of GameObjects that will be used as the valid collisions to determine if the door can be interacted with.
  4609. ### Class Methods
  4610. #### GetValue/0
  4611. > `public override float GetValue()`
  4612. * Parameters
  4613. * _none_
  4614. * Returns
  4615. * `float` - The actual position of the button.
  4616. The GetValue method returns the current position value of the slider.
  4617. #### GetNormalizedValue/0
  4618. > `public override float GetNormalizedValue()`
  4619. * Parameters
  4620. * _none_
  4621. * Returns
  4622. * `float` - The normalized position of the button.
  4623. The GetNormalizedValue method returns the current position value of the slider normalized between `0f` and `1f`.
  4624. #### SetValue/1
  4625. > `public override void SetValue(float value)`
  4626. * Parameters
  4627. * `float value` - The new position value
  4628. * Returns
  4629. * _none_
  4630. The SetValue method sets the current position value of the slider
  4631. #### GetStepValue/1
  4632. > `public virtual float GetStepValue(float currentValue)`
  4633. * Parameters
  4634. * `float currentValue` - The current position value of the slider to get the Step Value for.
  4635. * Returns
  4636. * `float` - The current Step Value based on the slider position.
  4637. The GetStepValue method returns the current position of the slider based on the step value range.
  4638. #### SetPositionTargetWithStepValue/1
  4639. > `public virtual void SetPositionTargetWithStepValue(float givenStepValue)`
  4640. * Parameters
  4641. * `float givenStepValue` - The step value within the `Step Value Range` to set the `Position Target` parameter to.
  4642. * Returns
  4643. * _none_
  4644. The SetTargetPositionWithStepValue sets the `Position Target` parameter but uses a value within the `Step Value Range`.
  4645. #### SetRestingPositionWithStepValue/1
  4646. > `public virtual void SetRestingPositionWithStepValue(float givenStepValue)`
  4647. * Parameters
  4648. * `float givenStepValue` - The step value within the `Step Value Range` to set the `Resting Position` parameter to.
  4649. * Returns
  4650. * _none_
  4651. The SetRestingPositionWithStepValue sets the `Resting Position` parameter but uses a value within the `Step Value Range`.
  4652. #### GetPositionFromStepValue/1
  4653. > `public virtual float GetPositionFromStepValue(float givenStepValue)`
  4654. * Parameters
  4655. * `float givenStepValue` - The step value to check the position for.
  4656. * Returns
  4657. * `float` - The position the slider would be at based on the given step value.
  4658. The GetPositionFromStepValue returns the position the slider would be at based on the given step value.
  4659. #### IsResting/0
  4660. > `public override bool IsResting()`
  4661. * Parameters
  4662. * _none_
  4663. * Returns
  4664. * `bool` - Returns `true` if the slider is at the resting position or within the resting position threshold.
  4665. The IsResting method returns whether the slider is currently in a resting state at the resting position or within the resting position threshold and not grabbed.
  4666. #### GetControlJoint/0
  4667. > `public virtual ConfigurableJoint GetControlJoint()`
  4668. * Parameters
  4669. * _none_
  4670. * Returns
  4671. * `ConfigurableJoint` - The joint associated with the control.
  4672. The GetControlJoint method returns the joint associated with the control.
  4673. #### GetControlInteractableObject/0
  4674. > `public virtual VRTK_InteractableObject GetControlInteractableObject()`
  4675. * Parameters
  4676. * _none_
  4677. * Returns
  4678. * `VRTK_InteractableObject` - The Interactable Object associated with the control.
  4679. The GetControlInteractableObject method returns the Interactable Object associated with the control.
  4680. ---
  4681. # Artificial Controllables (VRTK/Source/Scripts/Interactions/Controllables/Artificial)
  4682. A collection of scripts that provide artificial simulated controls that mimiic real life objects.
  4683. * [Artificial Pusher](#artificial-pusher-vrtk_artificialpusher)
  4684. * [Artificial Rotator](#artificial-rotator-vrtk_artificialrotator)
  4685. * [Artificial Slider](#artificial-slider-vrtk_artificialslider)
  4686. ---
  4687. ## Artificial Pusher (VRTK_ArtificialPusher)
  4688. > extends [VRTK_BaseControllable](#base-controllable-vrtk_basecontrollable)
  4689. ### Overview
  4690. An artificially simulated pushable pusher.
  4691. **Required Components:**
  4692. * `Collider` - A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects. Will be automatically added at runtime.
  4693. **Script Usage:**
  4694. * Place the `VRTK_ArtificialPusher` script onto the GameObject that is to become the pusher.
  4695. ### Inspector Parameters
  4696. * **Pressed Distance:** The distance along the `Operate Axis` until the pusher reaches the pressed position.
  4697. * **Min Max Limit Threshold:** The threshold in which the pusher's current normalized position along the `Operate Axis` has to be within the minimum and maximum limits of the pusher.
  4698. * **Resting Position:** The normalized position of the pusher between the original position and the pressed position that will be considered as the resting position for the pusher.
  4699. * **Resting Position Threshold:** The normalized value that the pusher can be from the `Resting Position` before the pusher is considered to be resting when not being interacted with.
  4700. * **Press Speed:** The speed in which the pusher moves towards to the `Pressed Distance` position.
  4701. * **Return Speed:** The speed in which the pusher will return to the `Target Position` of the pusher.
  4702. ### Class Methods
  4703. #### GetValue/0
  4704. > `public override float GetValue()`
  4705. * Parameters
  4706. * _none_
  4707. * Returns
  4708. * `float` - The actual position of the pusher.
  4709. The GetValue method returns the current position value of the pusher.
  4710. #### GetNormalizedValue/0
  4711. > `public override float GetNormalizedValue()`
  4712. * Parameters
  4713. * _none_
  4714. * Returns
  4715. * `float` - The normalized position of the pusher.
  4716. The GetNormalizedValue method returns the current position value of the pusher normalized between `0f` and `1f`.
  4717. #### SetValue/1
  4718. > `public override void SetValue(float value)`
  4719. * Parameters
  4720. * `float value` - Not used.
  4721. * Returns
  4722. * _none_
  4723. The SetValue method is not implemented as the pusher resets automatically.
  4724. #### IsResting/0
  4725. > `public override bool IsResting()`
  4726. * Parameters
  4727. * _none_
  4728. * Returns
  4729. * `bool` - Returns `true` if the pusher is currently at the resting position.
  4730. The IsResting method returns whether the pusher is currently at it's resting position.
  4731. #### SetStayPressed/1
  4732. > `public virtual void SetStayPressed(bool state)`
  4733. * Parameters
  4734. * `bool state` - The state to set the `Stay Pressed` parameter to.
  4735. * Returns
  4736. * _none_
  4737. The SetStayPressed method sets the `Stay Pressed` parameter to the given state and if the state is false and the pusher is currently pressed then it is reset to the original position.
  4738. #### SetPositionTarget/1
  4739. > `public virtual void SetPositionTarget(float normalizedTarget)`
  4740. * Parameters
  4741. * `float normalizedTarget` - The `Position Target` to set the pusher to between `0f` and `1f`.
  4742. * Returns
  4743. * _none_
  4744. The SetPositionTarget method sets the `Position Target` parameter to the given normalized value.
  4745. ---
  4746. ## Artificial Rotator (VRTK_ArtificialRotator)
  4747. > extends [VRTK_BaseControllable](#base-controllable-vrtk_basecontrollable)
  4748. ### Overview
  4749. A artificially simulated openable rotator.
  4750. **Required Components:**
  4751. * `Collider` - A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects. Will be automatically added at runtime.
  4752. **Script Usage:**
  4753. * Create a rotator container GameObject and set the GameObject that is to become the rotator as a child of the newly created container GameObject.
  4754. * Place the `VRTK_ArtificialRotator` script onto the GameObject that is to become the rotatable object and ensure the Transform rotation is `0, 0, 0`.
  4755. * Create a nested GameObject under the rotator GameObject and position it where the hinge should operate.
  4756. * Apply the nested hinge GameObject to the `Hinge Point` parameter on the Artificial Rotator script.
  4757. > The rotator GameObject must not be at the root level and needs to have the Transform rotation set to `0,0,0`. This is the reason for the container GameObject requirement. Any positioning of the rotator must be set on the parent container GameObject.
  4758. > The Artificial Rotator script GameObject will become the child of a runtime created GameObject that determines the rotational offset for the rotator.
  4759. ### Inspector Parameters
  4760. * **Hinge Point:** A Transform that denotes the position where the rotator will rotate around.
  4761. * **Angle Limits:** The minimum and maximum angle the rotator can rotate to.
  4762. * **Min Max Threshold Angle:** The angle at which the rotator rotation can be within the minimum or maximum angle before the minimum or maximum angles are considered reached.
  4763. * **Resting Angle:** The angle at which will be considered as the resting position of the rotator.
  4764. * **Force Resting Angle Threshold:** The threshold angle from the `Resting Angle` that the current angle of the rotator needs to be within to snap the rotator back to the `Resting Angle`.
  4765. * **Is Locked:** If this is checked then the rotator Rigidbody will have all rotations frozen.
  4766. * **Step Value Range:** The minimum and the maximum step values for the rotator to register along the `Operate Axis`.
  4767. * **Step Size:** The increments the rotator value will change in between the `Step Value Range`.
  4768. * **Use Step As Value:** If this is checked then the value for the rotator will be the step value and not the absolute rotation of the rotator Transform.
  4769. * **Snap To Step:** If this is checked then the rotator will snap to the angle of the nearest step along the value range.
  4770. * **Snap Force:** The speed in which the rotator will snap to the relevant angle along the `Operate Axis`
  4771. * **Precision Grab:** If this is checked then when the Interact Grab grabs the Interactable Object, it will grab it with precision and pick it up at the particular point on the Interactable Object that the Interact Touch is touching.
  4772. * **Detach Distance:** The maximum distance the grabbing object is away from the rotator before it is automatically released.
  4773. * **Rotation Action:** Determines how the rotation of the object is calculated based on the action of the grabbing object.
  4774. * **Grabbed Friction:** The simulated friction when the rotator is grabbed.
  4775. * **Released Friction:** The simulated friction when the rotator is released.
  4776. * **Only Interact With:** A collection of GameObjects that will be used as the valid collisions to determine if the rotator can be interacted with.
  4777. ### Class Methods
  4778. #### GetValue/0
  4779. > `public override float GetValue()`
  4780. * Parameters
  4781. * _none_
  4782. * Returns
  4783. * `float` - The actual rotation of the rotator.
  4784. The GetValue method returns the current rotation value of the rotator.
  4785. #### GetNormalizedValue/0
  4786. > `public override float GetNormalizedValue()`
  4787. * Parameters
  4788. * _none_
  4789. * Returns
  4790. * `float` - The normalized rotation of the rotator.
  4791. The GetNormalizedValue method returns the current rotation value of the rotator normalized between `0f` and `1f`.
  4792. #### SetValue/1
  4793. > `public override void SetValue(float value)`
  4794. * Parameters
  4795. * `float value` - The new rotation value
  4796. * Returns
  4797. * _none_
  4798. The SetValue method sets the current Angle of the rotator
  4799. #### GetContainer/0
  4800. > `public virtual GameObject GetContainer()`
  4801. * Parameters
  4802. * _none_
  4803. * Returns
  4804. * `GameObject` - The GameObject container of the rotator control.
  4805. The GetContainer method returns the GameObject that is generated to hold the rotator control.
  4806. #### GetStepValue/1
  4807. > `public virtual float GetStepValue(float currentValue)`
  4808. * Parameters
  4809. * `float currentValue` - The current angle value of the rotator to get the Step Value for.
  4810. * Returns
  4811. * `float` - The current Step Value based on the rotator angle.
  4812. The GetStepValue method returns the current angle of the rotator based on the step value range.
  4813. #### SetAngleTargetWithStepValue/1
  4814. > `public virtual void SetAngleTargetWithStepValue(float givenStepValue)`
  4815. * Parameters
  4816. * `float givenStepValue` - The step value within the `Step Value Range` to set the `Angle Target` parameter to.
  4817. * Returns
  4818. * _none_
  4819. The SetAngleTargetWithStepValue sets the `Angle Target` parameter but uses a value within the `Step Value Range`.
  4820. #### SetRestingAngleWithStepValue/1
  4821. > `public virtual void SetRestingAngleWithStepValue(float givenStepValue)`
  4822. * Parameters
  4823. * `float givenStepValue` - The step value within the `Step Value Range` to set the `Resting Angle` parameter to.
  4824. * Returns
  4825. * _none_
  4826. The SetRestingAngleWithStepValue sets the `Resting Angle` parameter but uses a value within the `Step Value Range`.
  4827. #### GetAngleFromStepValue/1
  4828. > `public virtual float GetAngleFromStepValue(float givenStepValue)`
  4829. * Parameters
  4830. * `float givenStepValue` - The step value to check the angle for.
  4831. * Returns
  4832. * `float` - The angle the rotator would be at based on the given step value.
  4833. The GetAngleFromStepValue returns the angle the rotator would be at based on the given step value.
  4834. #### SetAngleTarget/1
  4835. > `public virtual void SetAngleTarget(float newAngle)`
  4836. * Parameters
  4837. * `float newAngle` - The angle in which to rotate the rotator to.
  4838. * Returns
  4839. * _none_
  4840. The SetAngleTarget method sets a target angle to rotate the rotator to.
  4841. #### IsResting/0
  4842. > `public override bool IsResting()`
  4843. * Parameters
  4844. * _none_
  4845. * Returns
  4846. * `bool` - Returns `true` if the rotator is at the resting angle or within the resting angle threshold.
  4847. The IsResting method returns whether the rotator is at the resting angle or within the resting angle threshold.
  4848. #### GetControlInteractableObject/0
  4849. > `public virtual VRTK_InteractableObject GetControlInteractableObject()`
  4850. * Parameters
  4851. * _none_
  4852. * Returns
  4853. * `VRTK_InteractableObject` - The Interactable Object associated with the control.
  4854. The GetControlInteractableObject method returns the Interactable Object associated with the control.
  4855. ---
  4856. ## Artificial Slider (VRTK_ArtificialSlider)
  4857. > extends [VRTK_BaseControllable](#base-controllable-vrtk_basecontrollable)
  4858. ### Overview
  4859. A artificially simulated slider.
  4860. **Required Components:**
  4861. * `Collider` - A Unity Collider to determine when an interaction has occured. Can be a compound collider set in child GameObjects. Will be automatically added at runtime.
  4862. **Script Usage:**
  4863. * Create a slider container GameObject and set the GameObject that is to become the slider as a child of the container.
  4864. * Place the `VRTK_ArtificialSlider` script onto the GameObject that is to become the slider.
  4865. > The slider GameObject must not be at the root level and needs to have it's Transform position set to `0,0,0`. This is the reason for the container GameObject requirement. Any positioning of the slider must be set on the parent GameObject.
  4866. ### Inspector Parameters
  4867. * **Maximum Length:** The maximum length that the slider can be moved from the origin position across the `Operate Axis`. A negative value will allow it to move the opposite way.
  4868. * **Min Max Threshold:** The normalized position the slider can be within the minimum or maximum slider positions before the minimum or maximum positions are considered reached.
  4869. * **Resting Position:** The position the slider when it is at the default resting point given in a normalized value of `0f` (start point) to `1f` (end point).
  4870. * **Force Resting Position Threshold:** The normalized threshold value the slider has to be within the `Resting Position` before the slider is forced back to the `Resting Position` if it is not grabbed.
  4871. * **Step Value Range:** The minimum and the maximum step values for the slider to register along the `Operate Axis`.
  4872. * **Step Size:** The increments the slider value will change in between the `Step Value Range`.
  4873. * **Use Step As Value:** If this is checked then the value for the slider will be the step value and not the absolute position of the slider Transform.
  4874. * **Snap To Step:** If this is checked then the slider will snap to the position of the nearest step along the value range.
  4875. * **Snap Force:** The speed in which the slider will snap to the relevant point along the `Operate Axis`
  4876. * **Tracking Speed:** The speed in which to track the grabbed slider to the interacting object.
  4877. * **Precision Grab:** If this is checked then when the Interact Grab grabs the Interactable Object, it will grab it with precision and pick it up at the particular point on the Interactable Object that the Interact Touch is touching.
  4878. * **Detach Distance:** The maximum distance the grabbing object is away from the slider before it is automatically released.
  4879. * **Release Friction:** The amount of friction to the slider Rigidbody when it is released.
  4880. * **Only Interact With:** A collection of GameObjects that will be used as the valid collisions to determine if the door can be interacted with.
  4881. ### Class Methods
  4882. #### GetValue/0
  4883. > `public override float GetValue()`
  4884. * Parameters
  4885. * _none_
  4886. * Returns
  4887. * `float` - The actual position of the button.
  4888. The GetValue method returns the current position value of the slider.
  4889. #### GetNormalizedValue/0
  4890. > `public override float GetNormalizedValue()`
  4891. * Parameters
  4892. * _none_
  4893. * Returns
  4894. * `float` - The normalized position of the button.
  4895. The GetNormalizedValue method returns the current position value of the slider normalized between `0f` and `1f`.
  4896. #### SetValue/1
  4897. > `public override void SetValue(float value)`
  4898. * Parameters
  4899. * `float value` - The new position value
  4900. * Returns
  4901. * _none_
  4902. The SetValue method sets the current position value of the slider
  4903. #### GetStepValue/1
  4904. > `public virtual float GetStepValue(float currentValue)`
  4905. * Parameters
  4906. * `float currentValue` - The current position value of the slider to get the Step Value for.
  4907. * Returns
  4908. * `float` - The current Step Value based on the slider position.
  4909. The GetStepValue method returns the current position of the slider based on the step value range.
  4910. #### SetPositionTarget/2
  4911. > `public virtual void SetPositionTarget(float newPositionTarget, float speed)`
  4912. * Parameters
  4913. * `float newPositionTarget` - The new position target value.
  4914. * `float speed` - The speed to move to the new position target.
  4915. * Returns
  4916. * _none_
  4917. The SetPositionTarget method allows the setting of the `Position Target` parameter at runtime.
  4918. #### SetPositionTargetWithStepValue/2
  4919. > `public virtual void SetPositionTargetWithStepValue(float givenStepValue, float speed)`
  4920. * Parameters
  4921. * `float givenStepValue` - The step value within the `Step Value Range` to set the `Position Target` parameter to.
  4922. * `float speed` - The speed to move to the new position target.
  4923. * Returns
  4924. * _none_
  4925. The SetPositionTargetWithStepValue sets the `Position Target` parameter but uses a value within the `Step Value Range`.
  4926. #### SetRestingPositionWithStepValue/1
  4927. > `public virtual void SetRestingPositionWithStepValue(float givenStepValue)`
  4928. * Parameters
  4929. * `float givenStepValue` - The step value within the `Step Value Range` to set the `Resting Position` parameter to.
  4930. * Returns
  4931. * _none_
  4932. The SetRestingPositionWithStepValue sets the `Resting Position` parameter but uses a value within the `Step Value Range`.
  4933. #### GetPositionFromStepValue/1
  4934. > `public virtual float GetPositionFromStepValue(float givenStepValue)`
  4935. * Parameters
  4936. * `float givenStepValue` - The step value to check the position for.
  4937. * Returns
  4938. * `float` - The position the slider would be at based on the given step value.
  4939. The GetPositionFromStepValue returns the position the slider would be at based on the given step value.
  4940. #### IsResting/0
  4941. > `public override bool IsResting()`
  4942. * Parameters
  4943. * _none_
  4944. * Returns
  4945. * `bool` - Returns `true` if the slider is at the resting position or within the resting position threshold.
  4946. The IsResting method returns whether the slider is at the resting position or within the resting position threshold.
  4947. #### GetControlInteractableObject/0
  4948. > `public virtual VRTK_InteractableObject GetControlInteractableObject()`
  4949. * Parameters
  4950. * _none_
  4951. * Returns
  4952. * `VRTK_InteractableObject` - The Interactable Object associated with the control.
  4953. The GetControlInteractableObject method returns the Interactable Object associated with the control.
  4954. ---
  4955. # Presence (VRTK/Source/Scripts/Presence)
  4956. A collection of scripts that provide the ability to deal with tracking the world around the user in the scene.
  4957. * [Headset Collision](#headset-collision-vrtk_headsetcollision)
  4958. * [Headset Fade](#headset-fade-vrtk_headsetfade)
  4959. * [Headset Collision Fade](#headset-collision-fade-vrtk_headsetcollisionfade)
  4960. * [Headset Controller Aware](#headset-controller-aware-vrtk_headsetcontrolleraware)
  4961. * [Hip Tracking](#hip-tracking-vrtk_hiptracking)
  4962. * [Body Physics](#body-physics-vrtk_bodyphysics)
  4963. * [Position Rewind](#position-rewind-vrtk_positionrewind)
  4964. ---
  4965. ## Headset Collision (VRTK_HeadsetCollision)
  4966. ### Overview
  4967. Denotes when the HMD is colliding with valid geometry.
  4968. **Script Usage:**
  4969. * Place the `VRTK_HeadsetCollision` script on any active scene GameObject.
  4970. ### Inspector Parameters
  4971. * **Ignore Trigger Colliders:** If this is checked then the headset collision will ignore colliders set to `Is Trigger = true`.
  4972. * **Collider Radius:** The radius of the auto generated sphere collider for detecting collisions on the headset.
  4973. * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether any objects will be acted upon by the Headset Collision.
  4974. ### Class Variables
  4975. * `public bool headsetColliding` - Determines if the headset is currently colliding with another object. Default: `false`
  4976. * `public Collider collidingWith` - Stores the collider of what the headset is colliding with. Default: `null`
  4977. ### Class Events
  4978. * `HeadsetCollisionDetect` - Emitted when the user's headset collides with another game object.
  4979. * `HeadsetCollisionEnded` - Emitted when the user's headset stops colliding with a game object.
  4980. ### Unity Events
  4981. Adding the `VRTK_HeadsetCollision_UnityEvents` component to `VRTK_HeadsetCollision` object allows access to `UnityEvents` that will react identically to the Class Events.
  4982. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  4983. ### Event Payload
  4984. * `Collider collider` - The Collider of the game object the headset has collided with.
  4985. * `Transform currentTransform` - The current Transform of the object that the Headset Collision Fade script is attached to (Camera).
  4986. ### Class Methods
  4987. #### IsColliding/0
  4988. > `public virtual bool IsColliding()`
  4989. * Parameters
  4990. * _none_
  4991. * Returns
  4992. * `bool` - Returns `true` if the headset is currently colliding with a valid game object.
  4993. The IsColliding method is used to determine if the headset is currently colliding with a valid game object and returns true if it is and false if it is not colliding with anything or an invalid game object.
  4994. #### GetHeadsetColliderContainer/0
  4995. > `public virtual GameObject GetHeadsetColliderContainer()`
  4996. * Parameters
  4997. * _none_
  4998. * Returns
  4999. * `GameObject` - The auto generated headset collider GameObject.
  5000. The GetHeadsetColliderContainer method returns the auto generated GameObject that contains the headset collider.
  5001. ### Example
  5002. `VRTK/Examples/011_Camera_HeadSetCollisionFading` has collidable walls around the play area and if the user puts their head into any of the walls then the headset will fade to black.
  5003. ---
  5004. ## Headset Fade (VRTK_HeadsetFade)
  5005. ### Overview
  5006. Provides the ability to change the colour of the headset view to a specified colour over a given duration.
  5007. **Script Usage:**
  5008. * Place the `VRTK_HeadsetFade` script on any active scene GameObject.
  5009. ### Class Events
  5010. * `HeadsetFadeStart` - Emitted when the user's headset begins to fade to a given colour.
  5011. * `HeadsetFadeComplete` - Emitted when the user's headset has completed the fade and is now fully at the given colour.
  5012. * `HeadsetUnfadeStart` - Emitted when the user's headset begins to unfade back to a transparent colour.
  5013. * `HeadsetUnfadeComplete` - Emitted when the user's headset has completed unfading and is now fully transparent again.
  5014. ### Unity Events
  5015. Adding the `VRTK_HeadsetFade_UnityEvents` component to `VRTK_HeadsetFade` object allows access to `UnityEvents` that will react identically to the Class Events.
  5016. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  5017. ### Event Payload
  5018. * `float timeTillComplete` - A float that is the duration for the fade/unfade process has remaining.
  5019. * `Transform currentTransform` - The current Transform of the object that the Headset Fade script is attached to (Camera).
  5020. ### Class Methods
  5021. #### IsFaded/0
  5022. > `public virtual bool IsFaded()`
  5023. * Parameters
  5024. * _none_
  5025. * Returns
  5026. * `bool` - Returns `true` if the headset is currently fading or faded.
  5027. The IsFaded method returns true if the headset is currently fading or has completely faded and returns false if it is completely unfaded.
  5028. #### IsTransitioning/0
  5029. > `public virtual bool IsTransitioning()`
  5030. * Parameters
  5031. * _none_
  5032. * Returns
  5033. * `bool` - Returns `true` if the headset is currently in the process of fading or unfading.
  5034. The IsTransitioning method returns true if the headset is currently fading or unfading and returns false if it is completely faded or unfaded.
  5035. #### Fade/2
  5036. > `public virtual void Fade(Color color, float duration)`
  5037. * Parameters
  5038. * `Color color` - The colour to fade the headset view to.
  5039. * `float duration` - The time in seconds to take to complete the fade transition.
  5040. * Returns
  5041. * _none_
  5042. The Fade method initiates a change in the colour of the headset view to the given colour over a given duration.
  5043. #### Unfade/1
  5044. > `public virtual void Unfade(float duration)`
  5045. * Parameters
  5046. * `float duration` - The time in seconds to take to complete the unfade transition.
  5047. * Returns
  5048. * _none_
  5049. The Unfade method initiates the headset to change colour back to a transparent colour over a given duration.
  5050. ### Example
  5051. `VRTK/Examples/011_Camera_HeadSetCollisionFading` has collidable walls around the play area and if the user puts their head into any of the walls then the headset will fade to black.
  5052. ---
  5053. ## Headset Collision Fade (VRTK_HeadsetCollisionFade)
  5054. ### Overview
  5055. Initiates a fade of the headset view when a headset collision event is detected.
  5056. **Required Components:**
  5057. * `VRTK_HeadsetCollision` - A Headset Collision script to determine when the HMD has collided with valid geometry.
  5058. * `VRTK_HeadsetFade` - A Headset Fade script to alter the visible colour on the HMD view.
  5059. **Script Usage:**
  5060. * Place the `VRTK_HeadsetCollisionFade` script on any active scene GameObject.
  5061. ### Inspector Parameters
  5062. * **Time Till Fade:** The amount of time to wait until a fade occurs.
  5063. * **Blink Transition Speed:** The fade blink speed on collision.
  5064. * **Fade Color:** The colour to fade the headset to on collision.
  5065. * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether any objects will be acted upon by the Headset Collision Fade.
  5066. * **Headset Collision:** The VRTK Headset Collision script to use when determining headset collisions. If this is left blank then the script will need to be applied to the same GameObject.
  5067. * **Headset Fade:** The VRTK Headset Fade script to use when fading the headset. If this is left blank then the script will need to be applied to the same GameObject.
  5068. ### Example
  5069. `VRTK/Examples/011_Camera_HeadSetCollisionFading` has collidable walls around the play area and if the user puts their head into any of the walls then the headset will fade to black.
  5070. ---
  5071. ## Headset Controller Aware (VRTK_HeadsetControllerAware)
  5072. ### Overview
  5073. Determines whether the HMD is in line of sight to the controllers or if the headset is directly looking at one of the controllers.
  5074. **Script Usage:**
  5075. * Place the `VRTK_HeadsetControllerAware` script on any active scene GameObject.
  5076. ### Inspector Parameters
  5077. * **Track Left Controller:** If this is checked then the left controller will be checked if items obscure it's path from the headset.
  5078. * **Track Right Controller:** If this is checked then the right controller will be checked if items obscure it's path from the headset.
  5079. * **Controller Glance Radius:** The radius of the accepted distance from the controller origin point to determine if the controller is being looked at.
  5080. * **Custom Right Controller Origin:** A custom transform to provide the world space position of the right controller.
  5081. * **Custom Left Controller Origin:** A custom transform to provide the world space position of the left controller.
  5082. * **Custom Raycast:** A custom raycaster to use when raycasting to find controllers.
  5083. ### Class Events
  5084. * `ControllerObscured` - Emitted when the controller is obscured by another object.
  5085. * `ControllerUnobscured` - Emitted when the controller is no longer obscured by an object.
  5086. * `ControllerGlanceEnter` - Emitted when the controller is seen by the headset view.
  5087. * `ControllerGlanceExit` - Emitted when the controller is no longer seen by the headset view.
  5088. ### Unity Events
  5089. Adding the `VRTK_HeadsetControllerAware_UnityEvents` component to `VRTK_HeadsetControllerAware` object allows access to `UnityEvents` that will react identically to the Class Events.
  5090. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  5091. ### Event Payload
  5092. * `RaycastHit raycastHit` - The Raycast Hit struct of item that is obscuring the path to the controller.
  5093. * `VRTK_ControllerReference controllerReference` - The reference to the controller that is being or has been obscured or being or has been glanced.
  5094. ### Class Methods
  5095. #### LeftControllerObscured/0
  5096. > `public virtual bool LeftControllerObscured()`
  5097. * Parameters
  5098. * _none_
  5099. * Returns
  5100. * `bool` - Returns `true` if the path between the headset and the controller is obscured.
  5101. The LeftControllerObscured method returns the state of if the left controller is being obscured from the path of the headset.
  5102. #### RightControllerObscured/0
  5103. > `public virtual bool RightControllerObscured()`
  5104. * Parameters
  5105. * _none_
  5106. * Returns
  5107. * `bool` - Returns `true` if the path between the headset and the controller is obscured.
  5108. The RightControllerObscured method returns the state of if the right controller is being obscured from the path of the headset.
  5109. #### LeftControllerGlanced/0
  5110. > `public virtual bool LeftControllerGlanced()`
  5111. * Parameters
  5112. * _none_
  5113. * Returns
  5114. * `bool` - Returns `true` if the headset can currently see the controller within the given radius threshold.
  5115. the LeftControllerGlanced method returns the state of if the headset is currently looking at the left controller or not.
  5116. #### RightControllerGlanced/0
  5117. > `public virtual bool RightControllerGlanced()`
  5118. * Parameters
  5119. * _none_
  5120. * Returns
  5121. * `bool` - Returns `true` if the headset can currently see the controller within the given radius threshold.
  5122. the RightControllerGlanced method returns the state of if the headset is currently looking at the right controller or not.
  5123. ### Example
  5124. `VRTK/Examples/029_Controller_Tooltips` displays tooltips that have been added to the controllers and are only visible when the controller is being looked at.
  5125. ---
  5126. ## Hip Tracking (VRTK_HipTracking)
  5127. ### Overview
  5128. Attempts to provide the relative position of a hip without the need for additional hardware sensors.
  5129. **Script Usage:**
  5130. * Place the `VRTK_HipTracking` script on any active scene GameObject and this GameObject will then track to the estimated hip position.
  5131. ### Inspector Parameters
  5132. * **Head Offset:** Distance underneath Player Head for hips to reside.
  5133. * **Head Override:** Optional Transform to use as the Head Object for calculating hip position. If none is given one will try to be found in the scene.
  5134. * **Reference Up:** Optional Transform to use for calculating which way is 'Up' relative to the player for hip positioning.
  5135. ---
  5136. ## Body Physics (VRTK_BodyPhysics)
  5137. > extends [VRTK_DestinationMarker](#destination-marker-vrtk_destinationmarker)
  5138. ### Overview
  5139. Allows the play area to be affected by physics and detect collisions with other valid geometry.
  5140. **Optional Components:**
  5141. * `VRTK_BasicTeleport` - A Teleporter script to use when snapping the play area to the nearest floor when releasing from grab.
  5142. **Script Usage:**
  5143. * Place the `VRTK_BodyPhysics` script on any active scene GameObject.
  5144. ### Inspector Parameters
  5145. * **Enable Body Collisions:** If checked then the body collider and rigidbody will be used to check for rigidbody collisions.
  5146. * **Ignore Grabbed Collisions:** If this is checked then any items that are grabbed with the controller will not collide with the body collider. This is very useful if the user is required to grab and wield objects because if the collider was active they would bounce off the collider.
  5147. * **Ignore Collisions With:** An array of GameObjects that will not collide with the body collider.
  5148. * **Headset Y Offset:** The collider which is created for the user is set at a height from the user's headset position. If the collider is required to be lower to allow for room between the play area collider and the headset then this offset value will shorten the height of the generated collider.
  5149. * **Movement Threshold:** The amount of movement of the headset between the headset's current position and the current standing position to determine if the user is walking in play space and to ignore the body physics collisions if the movement delta is above this threshold.
  5150. * **Play Area Movement Threshold:** The amount of movement of the play area between the play area's current position and the previous position to determine if the user is moving play space.
  5151. * **Standing History Samples:** The maximum number of samples to collect of headset position before determining if the current standing position within the play space has changed.
  5152. * **Lean Y Threshold:** The `y` distance between the headset and the object being leaned over, if object being leaned over is taller than this threshold then the current standing position won't be updated.
  5153. * **Step Up Y Offset:** The maximum height to consider when checking if an object can be stepped upon to.
  5154. * **Step Thickness Multiplier:** The width/depth of the foot collider in relation to the radius of the body collider.
  5155. * **Step Drop Threshold:** The distance between the current play area Y position and the new stepped up Y position to consider a valid step up. A higher number can help with juddering on slopes or small increases in collider heights.
  5156. * **Custom Raycast:** A custom raycaster to use when raycasting to find floors.
  5157. * **Fall Restriction:** A check to see if the drop to nearest floor should take place. If the selected restrictor is still over the current floor then the drop to nearest floor will not occur. Works well for being able to lean over ledges and look down. Only works for falling down not teleporting up.
  5158. * **Gravity Fall Y Threshold:** When the `y` distance between the floor and the headset exceeds this distance and `Enable Body Collisions` is true then the rigidbody gravity will be used instead of teleport to drop to nearest floor.
  5159. * **Blink Y Threshold:** The `y` distance between the floor and the headset that must change before a fade transition is initiated. If the new user location is at a higher distance than the threshold then the headset blink transition will activate on teleport. If the new user location is within the threshold then no blink transition will happen, which is useful for walking up slopes, meshes and terrains to prevent constant blinking.
  5160. * **Floor Height Tolerance:** The amount the `y` position needs to change by between the current floor `y` position and the previous floor `y` position before a change in floor height is considered to have occurred. A higher value here will mean that a `Drop To Floor` will be less likely to happen if the `y` of the floor beneath the user hasn't changed as much as the given threshold.
  5161. * **Fall Check Precision:** The amount of rounding on the play area Y position to be applied when checking if falling is occuring.
  5162. * **Teleporter:** The VRTK Teleport script to use when snapping to floor. If this is left blank then a Teleport script will need to be applied to the same GameObject.
  5163. * **Custom Play Area Rigidbody:** A custom Rigidbody to apply to the play area. If one is not provided, then if an existing rigidbody is found on the play area GameObject it will be used, otherwise a default one will be created.
  5164. * **Custom Body Collider Container:** A GameObject to represent a custom body collider container. It should contain a collider component that will be used for detecting body collisions. If one isn't provided then it will be auto generated.
  5165. * **Custom Foot Collider Container:** A GameObject to represent a custom foot collider container. It should contain a collider component that will be used for detecting step collisions. If one isn't provided then it will be auto generated.
  5166. ### Class Variables
  5167. * `public enum FallingRestrictors` - Options for testing if a play space fall is valid
  5168. * `NoRestriction` - Always drop to nearest floor when the headset is no longer over the current standing object.
  5169. * `LeftController` - Don't drop to nearest floor if the Left Controller is still over the current standing object even if the headset isn't.
  5170. * `RightController` - Don't drop to nearest floor if the Right Controller is still over the current standing object even if the headset isn't.
  5171. * `EitherController` - Don't drop to nearest floor if Either Controller is still over the current standing object even if the headset isn't.
  5172. * `BothControllers` - Don't drop to nearest floor only if Both Controllers are still over the current standing object even if the headset isn't.
  5173. * `AlwaysRestrict` - Never drop to nearest floor when the headset is no longer over the current standing object.
  5174. ### Class Events
  5175. * `StartFalling` - Emitted when a fall begins.
  5176. * `StopFalling` - Emitted when a fall ends.
  5177. * `StartMoving` - Emitted when movement in the play area begins.
  5178. * `StopMoving` - Emitted when movement in the play area ends.
  5179. * `StartColliding` - Emitted when the body collider starts colliding with another game object.
  5180. * `StopColliding` - Emitted when the body collider stops colliding with another game object.
  5181. * `StartLeaning` - Emitted when the body collider starts leaning over another game object.
  5182. * `StopLeaning` - Emitted when the body collider stops leaning over another game object.
  5183. * `StartTouchingGround` - Emitted when the body collider starts touching the ground.
  5184. * `StopTouchingGround` - Emitted when the body collider stops touching the ground.
  5185. ### Unity Events
  5186. Adding the `VRTK_BodyPhysics_UnityEvents` component to `VRTK_BodyPhysics` object allows access to `UnityEvents` that will react identically to the Class Events.
  5187. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  5188. ### Event Payload
  5189. * `GameObject target` - The target GameObject the event is dealing with.
  5190. * `Collider collider` - An optional collider that the body physics is colliding with.
  5191. ### Class Methods
  5192. #### ArePhysicsEnabled/0
  5193. > `public virtual bool ArePhysicsEnabled()`
  5194. * Parameters
  5195. * _none_
  5196. * Returns
  5197. * `bool` - Returns `true` if the body physics will interact with other scene physics objects and `false` if the body physics will ignore other scene physics objects.
  5198. The ArePhysicsEnabled method determines whether the body physics are set to interact with other scene physics objects.
  5199. #### ApplyBodyVelocity/3
  5200. > `public virtual void ApplyBodyVelocity(Vector3 velocity, bool forcePhysicsOn = false, bool applyMomentum = false)`
  5201. * Parameters
  5202. * `Vector3 velocity` - The velocity to apply.
  5203. * `bool forcePhysicsOn` - If `true` will toggle the body collision physics back on if enable body collisions is true.
  5204. * `bool applyMomentum` - If `true` then the existing momentum of the play area will be applied as a force to the resulting velocity.
  5205. * Returns
  5206. * _none_
  5207. The ApplyBodyVelocity method applies a given velocity to the rigidbody attached to the body physics.
  5208. #### ToggleOnGround/1
  5209. > `public virtual void ToggleOnGround(bool state)`
  5210. * Parameters
  5211. * `bool state` - If `true` then body physics are set to being on the ground.
  5212. * Returns
  5213. * _none_
  5214. The ToggleOnGround method sets whether the body is considered on the ground or not.
  5215. #### TogglePreventSnapToFloor/1
  5216. > `public virtual void TogglePreventSnapToFloor(bool state)`
  5217. * Parameters
  5218. * `bool state` - If `true` the the snap to floor mechanic will not execute.
  5219. * Returns
  5220. * _none_
  5221. The PreventSnapToFloor method sets whether the snap to floor mechanic should be used.
  5222. #### ForceSnapToFloor/0
  5223. > `public virtual void ForceSnapToFloor()`
  5224. * Parameters
  5225. * _none_
  5226. * Returns
  5227. * _none_
  5228. The ForceSnapToFloor method disables the prevent snap to floor and forces the snap to nearest floor action.
  5229. #### IsFalling/0
  5230. > `public virtual bool IsFalling()`
  5231. * Parameters
  5232. * _none_
  5233. * Returns
  5234. * `bool` - Returns `true` if the body is currently falling via gravity or via teleport.
  5235. The IsFalling method returns the falling state of the body.
  5236. #### IsMoving/0
  5237. > `public virtual bool IsMoving()`
  5238. * Parameters
  5239. * _none_
  5240. * Returns
  5241. * `bool` - Returns true if the user is currently walking around their play area space.
  5242. The IsMoving method returns the moving within play area state of the body.
  5243. #### IsLeaning/0
  5244. > `public virtual bool IsLeaning()`
  5245. * Parameters
  5246. * _none_
  5247. * Returns
  5248. * `bool` - Returns `true` if the user is considered to be leaning over an object.
  5249. The IsLeaning method returns the leaning state of the user.
  5250. #### OnGround/0
  5251. > `public virtual bool OnGround()`
  5252. * Parameters
  5253. * _none_
  5254. * Returns
  5255. * `bool` - Returns `true` if the play area is on the ground and false if the play area is in the air.
  5256. The OnGround method returns whether the user is currently standing on the ground or not.
  5257. #### GetVelocity/0
  5258. > `public virtual Vector3 GetVelocity()`
  5259. * Parameters
  5260. * _none_
  5261. * Returns
  5262. * `Vector3` - The velocity of the body physics rigidbody.
  5263. The GetVelocity method returns the velocity of the body physics rigidbody.
  5264. #### GetAngularVelocity/0
  5265. > `public virtual Vector3 GetAngularVelocity()`
  5266. * Parameters
  5267. * _none_
  5268. * Returns
  5269. * `Vector3` - The angular velocity of the body physics rigidbody.
  5270. The GetAngularVelocity method returns the angular velocity of the body physics rigidbody.
  5271. #### ResetVelocities/0
  5272. > `public virtual void ResetVelocities()`
  5273. * Parameters
  5274. * _none_
  5275. * Returns
  5276. * _none_
  5277. The ResetVelocities method sets the rigidbody velocity and angular velocity to zero to stop the Play Area rigidbody from continuing to move if it has a velocity already.
  5278. #### ResetFalling/0
  5279. > `public virtual void ResetFalling()`
  5280. * Parameters
  5281. * _none_
  5282. * Returns
  5283. * _none_
  5284. The ResetFalling method force stops any falling states and conditions that might be set on this object.
  5285. #### GetBodyColliderContainer/0
  5286. > `public virtual GameObject GetBodyColliderContainer()`
  5287. * Parameters
  5288. * _none_
  5289. * Returns
  5290. * `GameObject` - The auto generated body collider GameObject.
  5291. * `GameObject` -
  5292. The GetBodyColliderContainer method returns the auto generated GameObject that contains the body colliders.
  5293. #### GetFootColliderContainer/0
  5294. > `public virtual GameObject GetFootColliderContainer()`
  5295. * Parameters
  5296. * _none_
  5297. * Returns
  5298. * `GameObject` - The auto generated foot collider GameObject.
  5299. * `GameObject` -
  5300. The GetFootColliderContainer method returns the auto generated GameObject that contains the foot colliders.
  5301. #### GetCurrentCollidingObject/0
  5302. > `public virtual GameObject GetCurrentCollidingObject()`
  5303. * Parameters
  5304. * _none_
  5305. * Returns
  5306. * `GameObject` - The GameObject that is colliding with the body physics colliders.
  5307. The GetCurrentCollidingObject method returns the object that the body physics colliders are currently colliding with.
  5308. #### ResetIgnoredCollisions/0
  5309. > `public virtual void ResetIgnoredCollisions()`
  5310. * Parameters
  5311. * _none_
  5312. * Returns
  5313. * _none_
  5314. The ResetIgnoredCollisions method is used to clear any stored ignored colliders in case the `Ignore Collisions On` array parameter is changed at runtime. This needs to be called manually if changes are made at runtime.
  5315. #### SweepCollision/2
  5316. > `public virtual bool SweepCollision(Vector3 direction, float maxDistance)`
  5317. * Parameters
  5318. * `Vector3 direction` - The direction to test for the potential collision.
  5319. * `float maxDistance` - The maximum distance to check for a potential collision.
  5320. * Returns
  5321. * `bool` - Returns `true` if a collision will occur on the given direction over the given maxium distance. Returns `false` if there is no collision about to happen.
  5322. The SweepCollision method tests to see if a collision will occur with the body collider in a given direction and distance.
  5323. ### Example
  5324. `VRTK/Examples/017_CameraRig_TouchpadWalking` has a collection of walls and slopes that can be traversed by the user with the touchpad but the user cannot pass through the objects as they are collidable and the rigidbody physics won't allow the intersection to occur.
  5325. ---
  5326. ## Position Rewind (VRTK_PositionRewind)
  5327. ### Overview
  5328. Attempts to rewind the position of the play area to a last know valid position upon the headset collision event.
  5329. **Required Components:**
  5330. * `VRTK_BodyPhysics` - A Body Physics script to manage the collisions of the body presence within the scene.
  5331. * `VRTK_HeadsetCollision` - A Headset Collision script to determine when the headset is colliding with valid geometry.
  5332. **Script Usage:**
  5333. * Place the `VRTK_PositionRewind` script on any active scene GameObject.
  5334. ### Inspector Parameters
  5335. * **Collision Detector:** The colliders to determine if a collision has occured for the rewind to be actioned.
  5336. * **Ignore Trigger Colliders:** If this is checked then the collision detector will ignore colliders set to `Is Trigger = true`.
  5337. * **Rewind Delay:** The amount of time from original headset collision until the rewind to the last good known position takes place.
  5338. * **Pushback Distance:** The additional distance to push the play area back upon rewind to prevent being right next to the wall again.
  5339. * **Crouch Threshold:** The threshold to determine how low the headset has to be before it is considered the user is crouching. The last good position will only be recorded in a non-crouching position.
  5340. * **Crouch Rewind Threshold:** The threshold to determind how low the headset can be to perform a position rewind. If the headset Y position is lower than this threshold then a rewind won't occur.
  5341. * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether any objects will be acted upon by the Position Rewind.
  5342. * **Body Physics:** The VRTK Body Physics script to use for the collisions and rigidbodies. If this is left blank then the first Body Physics script found in the scene will be used.
  5343. * **Headset Collision:** The VRTK Headset Collision script to use to determine if the headset is colliding. If this is left blank then the script will need to be applied to the same GameObject.
  5344. ### Class Variables
  5345. * `public enum CollisionDetectors` - Valid collision detectors.
  5346. * `HeadsetOnly` - Listen for collisions on the headset collider only.
  5347. * `BodyOnly` - Listen for collisions on the body physics collider only.
  5348. * `HeadsetAndBody` - Listen for collisions on both the headset collider and body physics collider.
  5349. ### Class Events
  5350. * `PositionRewindToSafe` - Emitted when the draggable item is successfully dropped.
  5351. ### Unity Events
  5352. Adding the `VRTK_PositionRewind_UnityEvents` component to `VRTK_PositionRewind` object allows access to `UnityEvents` that will react identically to the Class Events.
  5353. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  5354. ### Event Payload
  5355. * `Vector3 collidedPosition` - The position of the play area when it collded.
  5356. * `Vector3 resetPosition` - The position of the play area when it has been rewinded to a safe position.
  5357. ### Class Methods
  5358. #### SetLastGoodPosition/0
  5359. > `public virtual void SetLastGoodPosition()`
  5360. * Parameters
  5361. * _none_
  5362. * Returns
  5363. * _none_
  5364. The SetLastGoodPosition method stores the current valid play area and headset position.
  5365. #### RewindPosition/0
  5366. > `public virtual void RewindPosition()`
  5367. * Parameters
  5368. * _none_
  5369. * Returns
  5370. * _none_
  5371. The RewindPosition method resets the play area position to the last known good position of the play area.
  5372. ### Example
  5373. `VRTK/Examples/017_CameraRig_TouchpadWalking` has the position rewind script to reset the user's position if they walk into objects.
  5374. ---
  5375. # UI (VRTK/Source/Scripts/UI)
  5376. A collection of scripts that provide the ability to utilise and interact with Unity UI elements.
  5377. * [UI Canvas](#ui-canvas-vrtk_uicanvas)
  5378. * [UI Pointer](#ui-pointer-vrtk_uipointer)
  5379. * [UI Draggable Item](#ui-draggable-item-vrtk_uidraggableitem)
  5380. * [UI Drop Zone](#ui-drop-zone-vrtk_uidropzone)
  5381. ---
  5382. ## UI Canvas (VRTK_UICanvas)
  5383. ### Overview
  5384. Denotes a Unity World UI Canvas can be interacted with a UIPointer script.
  5385. **Script Usage:**
  5386. * Place the `VRTK_UICanvas` script on the Unity World UI Canvas to allow UIPointer interactions with.
  5387. **Script Dependencies:**
  5388. * A UI Pointer attached to another GameObject (e.g. controller script alias) to interact with the UICanvas script.
  5389. ### Inspector Parameters
  5390. * **Click On Pointer Collision:** Determines if a UI Click action should happen when a UI Pointer game object collides with this canvas.
  5391. * **Auto Activate Within Distance:** Determines if a UI Pointer will be auto activated if a UI Pointer game object comes within the given distance of this canvas. If a value of `0` is given then no auto activation will occur.
  5392. ### Example
  5393. `VRTK/Examples/034_Controls_InteractingWithUnityUI` uses the `VRTK_UICanvas` script on two of the canvases to show how the UI Pointer can interact with them.
  5394. ---
  5395. ## UI Pointer (VRTK_UIPointer)
  5396. ### Overview
  5397. Provides the ability to interact with UICanvas elements and the contained Unity UI elements within.
  5398. **Optional Components:**
  5399. * `VRTK_ControllerEvents` - The events component to listen for the button presses on. This must be applied on the same GameObject as this script if one is not provided via the `Controller` parameter.
  5400. **Script Usage:**
  5401. * Place the `VRTK_UIPointer` script on either:
  5402. * The controller script alias GameObject of the controller to emit the UIPointer from (e.g. Right Controller Script Alias).
  5403. * Any other scene GameObject and provide a valid `Transform` component to the `Pointer Origin Transform` parameter of this script. This does not have to be a controller and can be any GameObject that will emit the UIPointer.
  5404. **Script Dependencies:**
  5405. * A UI Canvas attached to a Unity World UI Canvas.
  5406. ### Inspector Parameters
  5407. * **Activation Button:** The button used to activate/deactivate the UI raycast for the pointer.
  5408. * **Activation Mode:** Determines when the UI pointer should be active.
  5409. * **Selection Button:** The button used to execute the select action at the pointer's target position.
  5410. * **Click Method:** Determines when the UI Click event action should happen.
  5411. * **Attempt Click On Deactivate:** Determines whether the UI click action should be triggered when the pointer is deactivated. If the pointer is hovering over a clickable element then it will invoke the click action on that element. Note: Only works with `Click Method = Click_On_Button_Up`
  5412. * **Click After Hover Duration:** The amount of time the pointer can be over the same UI element before it automatically attempts to click it. 0f means no click attempt will be made.
  5413. * **Maximum Length:** The maximum length the UI Raycast will reach.
  5414. * **Attached To:** An optional GameObject that determines what the pointer is to be attached to. If this is left blank then the GameObject the script is on will be used.
  5415. * **Controller Events:** The Controller Events that will be used to toggle the pointer. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.
  5416. * **Custom Origin:** A custom transform to use as the origin of the pointer. If no pointer origin transform is provided then the transform the script is attached to is used.
  5417. ### Class Variables
  5418. * `public enum ActivationMethods` - Methods of activation.
  5419. * `HoldButton` - Only activates the UI Pointer when the Pointer button on the controller is pressed and held down.
  5420. * `ToggleButton` - Activates the UI Pointer on the first click of the Pointer button on the controller and it stays active until the Pointer button is clicked again.
  5421. * `AlwaysOn` - The UI Pointer is always active regardless of whether the Pointer button on the controller is pressed or not.
  5422. * `public enum ClickMethods` - Methods of when to consider a UI Click action
  5423. * `ClickOnButtonUp` - Consider a UI Click action has happened when the UI Click alias button is released.
  5424. * `ClickOnButtonDown` - Consider a UI Click action has happened when the UI Click alias button is pressed.
  5425. * `public GameObject autoActivatingCanvas` - The GameObject of the front trigger activator of the canvas currently being activated by this pointer. Default: `null`
  5426. * `public bool collisionClick` - Determines if the UI Pointer has collided with a valid canvas that has collision click turned on. Default: `false`
  5427. ### Class Events
  5428. * `ActivationButtonPressed` - Emitted when the UI activation button is pressed.
  5429. * `ActivationButtonReleased` - Emitted when the UI activation button is released.
  5430. * `SelectionButtonPressed` - Emitted when the UI selection button is pressed.
  5431. * `SelectionButtonReleased` - Emitted when the UI selection button is released.
  5432. * `UIPointerElementEnter` - Emitted when the UI Pointer is colliding with a valid UI element.
  5433. * `UIPointerElementExit` - Emitted when the UI Pointer is no longer colliding with any valid UI elements.
  5434. * `UIPointerElementClick` - Emitted when the UI Pointer has clicked the currently collided UI element.
  5435. * `UIPointerElementDragStart` - Emitted when the UI Pointer begins dragging a valid UI element.
  5436. * `UIPointerElementDragEnd` - Emitted when the UI Pointer stops dragging a valid UI element.
  5437. ### Unity Events
  5438. Adding the `VRTK_UIPointer_UnityEvents` component to `VRTK_UIPointer` object allows access to `UnityEvents` that will react identically to the Class Events.
  5439. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  5440. ### Event Payload
  5441. * `VRTK_ControllerReference controllerReference` - The reference to the controller that was used.
  5442. * `bool isActive` - The state of whether the UI Pointer is currently active or not.
  5443. * `GameObject currentTarget` - The current UI element that the pointer is colliding with.
  5444. * `GameObject previousTarget` - The previous UI element that the pointer was colliding with.
  5445. * `RaycastResult raycastResult` - The raw raycast result of the UI ray collision.
  5446. ### Class Methods
  5447. #### GetPointerLength/1
  5448. > `public static float GetPointerLength(int pointerId)`
  5449. * Parameters
  5450. * `int pointerId` - The pointer ID for the UI Pointer to recieve the length for.
  5451. * Returns
  5452. * `float` - The maximum length the UI Pointer will cast to.
  5453. The GetPointerLength method retrieves the maximum UI Pointer length for the given pointer ID.
  5454. #### SetEventSystem/1
  5455. > `public virtual VRTK_VRInputModule SetEventSystem(EventSystem eventSystem)`
  5456. * Parameters
  5457. * `EventSystem eventSystem` - The global Unity event system to be used by the UI pointers.
  5458. * Returns
  5459. * `VRTK_VRInputModule` - A custom input module that is used to detect input from VR pointers.
  5460. The SetEventSystem method is used to set up the global Unity event system for the UI pointer. It also handles disabling the existing Standalone Input Module that exists on the EventSystem and adds a custom VRTK Event System VR Input component that is required for interacting with the UI with VR inputs.
  5461. #### RemoveEventSystem/0
  5462. > `public virtual void RemoveEventSystem()`
  5463. * Parameters
  5464. * _none_
  5465. * Returns
  5466. * _none_
  5467. The RemoveEventSystem resets the Unity EventSystem back to the original state before the VRTK_VRInputModule was swapped for it.
  5468. #### PointerActive/0
  5469. > `public virtual bool PointerActive()`
  5470. * Parameters
  5471. * _none_
  5472. * Returns
  5473. * `bool` - Returns `true` if the ui pointer should be currently active.
  5474. The PointerActive method determines if the ui pointer beam should be active based on whether the pointer alias is being held and whether the Hold Button To Use parameter is checked.
  5475. #### IsActivationButtonPressed/0
  5476. > `public virtual bool IsActivationButtonPressed()`
  5477. * Parameters
  5478. * _none_
  5479. * Returns
  5480. * `bool` - Returns `true` if the activation button is active.
  5481. The IsActivationButtonPressed method is used to determine if the configured activation button is currently in the active state.
  5482. #### IsSelectionButtonPressed/0
  5483. > `public virtual bool IsSelectionButtonPressed()`
  5484. * Parameters
  5485. * _none_
  5486. * Returns
  5487. * `bool` - Returns `true` if the selection button is active.
  5488. The IsSelectionButtonPressed method is used to determine if the configured selection button is currently in the active state.
  5489. #### ValidClick/2
  5490. > `public virtual bool ValidClick(bool checkLastClick, bool lastClickState = false)`
  5491. * Parameters
  5492. * `bool checkLastClick` - If this is true then the last frame's state of the UI Click button is also checked to see if a valid click has happened.
  5493. * `bool lastClickState` - This determines what the last frame's state of the UI Click button should be in for it to be a valid click.
  5494. * Returns
  5495. * `bool` - Returns `true` if the UI Click button is in a valid state to action a click, returns `false` if it is not in a valid state.
  5496. The ValidClick method determines if the UI Click button is in a valid state to register a click action.
  5497. #### GetOriginPosition/0
  5498. > `public virtual Vector3 GetOriginPosition()`
  5499. * Parameters
  5500. * _none_
  5501. * Returns
  5502. * `Vector3` - A Vector3 of the pointer transform position
  5503. The GetOriginPosition method returns the relevant transform position for the pointer based on whether the pointerOriginTransform variable is valid.
  5504. #### GetOriginForward/0
  5505. > `public virtual Vector3 GetOriginForward()`
  5506. * Parameters
  5507. * _none_
  5508. * Returns
  5509. * `Vector3` - A Vector3 of the pointer transform forward
  5510. The GetOriginPosition method returns the relevant transform forward for the pointer based on whether the pointerOriginTransform variable is valid.
  5511. ### Example
  5512. `VRTK/Examples/034_Controls_InteractingWithUnityUI` uses the `VRTK_UIPointer` script on the right Controller to allow for the interaction with Unity UI elements using a Simple Pointer beam. The left Controller controls a Simple Pointer on the headset to demonstrate gaze interaction with Unity UI elements.
  5513. ---
  5514. ## UI Draggable Item (VRTK_UIDraggableItem)
  5515. > extends MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
  5516. ### Overview
  5517. Denotes a Unity UI Element as being draggable on the UI Canvas.
  5518. > If a UI Draggable item is set to `Restrict To Drop Zone = true` then the UI Draggable item must be a child of an element that has the VRTK_UIDropZone script applied to it to ensure it starts in a valid drop zone.
  5519. **Script Usage:**
  5520. * Place the `VRTK_UIDraggableItem` script on the Unity UI element that is to be dragged.
  5521. ### Inspector Parameters
  5522. * **Restrict To Drop Zone:** If checked then the UI element can only be dropped in valid a VRTK_UIDropZone object and must start as a child of a VRTK_UIDropZone object. If unchecked then the UI element can be dropped anywhere on the canvas.
  5523. * **Restrict To Original Canvas:** If checked then the UI element can only be dropped on the original parent canvas. If unchecked the UI element can be dropped on any valid VRTK_UICanvas.
  5524. * **Forward Offset:** The offset to bring the UI element forward when it is being dragged.
  5525. ### Class Variables
  5526. * `public GameObject validDropZone` - The current valid drop zone the dragged element is hovering over.
  5527. ### Class Events
  5528. * `DraggableItemDropped` - Emitted when the draggable item is successfully dropped.
  5529. * `DraggableItemReset` - Emitted when the draggable item is reset.
  5530. ### Unity Events
  5531. Adding the `VRTK_UIDraggableItem_UnityEvents` component to `VRTK_UIDraggableItem` object allows access to `UnityEvents` that will react identically to the Class Events.
  5532. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  5533. ### Event Payload
  5534. * `GameObject target` - The target the item is dragged onto.
  5535. ### Example
  5536. `VRTK/Examples/034_Controls_InteractingWithUnityUI` demonstrates a collection of UI elements that are draggable
  5537. ---
  5538. ## UI Drop Zone (VRTK_UIDropZone)
  5539. > extends MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
  5540. ### Overview
  5541. Specifies a Unity UI Element as being a valid drop zone location for a UI Draggable element.
  5542. > It's appropriate to use a Panel UI element as a drop zone with a layout group applied so new children dropped into the drop zone automatically align.
  5543. **Script Usage:**
  5544. * Place the `VRTK_UIDropZone` script on the Unity UI element that is to become the drop zone.
  5545. ### Example
  5546. `VRTK/Examples/034_Controls_InteractingWithUnityUI` demonstrates a collection of UI Drop Zones.
  5547. ---
  5548. # Utilities (VRTK/Source/Scripts/Utilities)
  5549. A collection of scripts that provide useful functionality to aid the creation process.
  5550. * [SDK Manager](#sdk-manager-scriptingdefinesymbolpredicateinfo)
  5551. * [SDK Setup](#sdk-setup-vrtk_sdksetup)
  5552. * [SDK Info](#sdk-info-vrtk_sdkinfo)
  5553. * [Device Finder](#device-finder-vrtk_devicefinder)
  5554. * [Shared Methods](#shared-methods-vrtk_sharedmethods)
  5555. * [Policy List](#policy-list-vrtk_policylist)
  5556. * [Custom Raycast](#custom-raycast-vrtk_customraycast)
  5557. * [Nav Mesh Data](#nav-mesh-data-vrtk_navmeshdata)
  5558. * [Adaptive Quality](#adaptive-quality-vrtk_adaptivequality)
  5559. * [Object Follow](#object-follow-vrtk_objectfollow)
  5560. * [Rigidbody Follow](#rigidbody-follow-vrtk_rigidbodyfollow)
  5561. * [Transform Follow](#transform-follow-vrtk_transformfollow)
  5562. * [SDK Object Alias](#sdk-object-alias-vrtk_sdkobjectalias)
  5563. * [SDK Transform Modify](#sdk-transform-modify-vrtk_sdktransformmodify)
  5564. * [SDK Object State](#sdk-object-state-vrtk_sdkobjectstate)
  5565. * [SDK Input Override](#sdk-input-override-vrtk_sdkinputoverride)
  5566. * [Velocity Estimator](#velocity-estimator-vrtk_velocityestimator)
  5567. ---
  5568. ## SDK Manager (ScriptingDefineSymbolPredicateInfo)
  5569. ### Overview
  5570. A helper class that simply holds references to both the SDK_ScriptingDefineSymbolPredicateAttribute and the method info of the method the attribute is defined on.
  5571. ### Inspector Parameters
  5572. * **Auto Manage Script Defines:** Determines whether the scripting define symbols required by the installed SDKs are automatically added to and removed from the player settings.
  5573. * **Script Alias Left Controller:** A reference to the GameObject that contains any scripts that apply to the Left Hand Controller.
  5574. * **Script Alias Right Controller:** A reference to the GameObject that contains any scripts that apply to the Right Hand Controller.
  5575. * **Auto Manage VR Settings:** Determines whether the VR settings of the Player Settings are automatically adjusted to allow for all the used SDKs in the SDK Setups list below.
  5576. * **Auto Load Setup:** Determines whether the SDK Setups list below is used whenever the SDK Manager is enabled. The first loadable Setup is then loaded.
  5577. * **Setups:** The list of SDK Setups to choose from.
  5578. * **Exclude Target Groups:** The list of Build Target Groups to exclude.
  5579. ### Class Variables
  5580. * `public readonly SDK_ScriptingDefineSymbolPredicateAttribute attribute` - The predicate attribute.
  5581. * `public readonly MethodInfo methodInfo` - The method info of the method the attribute is defined on.
  5582. * `public static ReadOnlyCollection<ScriptingDefineSymbolPredicateInfo> AvailableScriptingDefineSymbolPredicateInfos { get private set }` - All found scripting define symbol predicate attributes with associated method info.
  5583. * `public static readonly Dictionary<Type, Type> SDKFallbackTypesByBaseType` - Specifies the fallback SDK types for every base SDK type. Default: `new Dictionary<Type, Type>`
  5584. * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableSystemSDKInfos { get private set }` - All available system SDK infos.
  5585. * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableBoundariesSDKInfos { get private set }` - All available boundaries SDK infos.
  5586. * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableHeadsetSDKInfos { get private set }` - All available headset SDK infos.
  5587. * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableControllerSDKInfos { get private set }` - All available controller SDK infos.
  5588. * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledSystemSDKInfos { get private set }` - All installed system SDK infos. This is a subset of `AvailableSystemSDKInfos`. It contains only those available SDK infos for which an SDK_ScriptingDefineSymbolPredicateAttribute exists that uses the same symbol and whose associated method returns true.
  5589. * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledBoundariesSDKInfos { get private set }` - All installed boundaries SDK infos. This is a subset of `AvailableBoundariesSDKInfos`. It contains only those available SDK infos for which an SDK_ScriptingDefineSymbolPredicateAttribute exists that uses the same symbol and whose associated method returns true.
  5590. * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledHeadsetSDKInfos { get private set }` - All installed headset SDK infos. This is a subset of `AvailableHeadsetSDKInfos`. It contains only those available SDK infos for which an SDK_ScriptingDefineSymbolPredicateAttribute exists that uses the same symbol and whose associated method returns true.
  5591. * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledControllerSDKInfos { get private set }` - All installed controller SDK infos. This is a subset of `AvailableControllerSDKInfos`. It contains only those available SDK infos for which an SDK_ScriptingDefineSymbolPredicateAttribute exists that uses the same symbol and whose associated method returns true.
  5592. * `public static VRTK_SDKManager instance` - The singleton instance to access the SDK Manager variables from.
  5593. * `public static HashSet<Behaviour> delayedToggleBehaviours` - A collection of behaviours to toggle on loaded setup change. Default: `new HashSet<Behaviour>()`
  5594. * `public List<SDK_ScriptingDefineSymbolPredicateAttribute> activeScriptingDefineSymbolsWithoutSDKClasses` - The active (i.e. to be added to the PlayerSettings) scripting define symbol predicate attributes that have no associated SDK classes. Default: `new List<SDK_ScriptingDefineSymbolPredicateAttribute>()`
  5595. * `public VRTK_SDKSetup loadedSetup` - The loaded SDK Setup. `null` if no setup is currently loaded.
  5596. * `public ReadOnlyCollection<Behaviour> behavioursToToggleOnLoadedSetupChange { get private set }` - All behaviours that need toggling whenever `loadedSetup` changes.
  5597. ### Class Events
  5598. * `LoadedSetupChanged` - The event invoked whenever the loaded SDK Setup changes.
  5599. ### Unity Events
  5600. Adding the `VRTK_SDKManager_UnityEvents` component to `VRTK_SDKManager` object allows access to `UnityEvents` that will react identically to the Class Events.
  5601. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  5602. ### Event Payload
  5603. * `VRTK_SDKSetup previousSetup` - The previous loaded Setup. `null` if no previous Setup was loaded.
  5604. * `VRTK_SDKSetup currentSetup` - The current loaded Setup. `null` if no Setup is loaded anymore. See `errorMessage` to check whether this is `null` because of an error.
  5605. * `string errorMessage` - Explains why loading a list of Setups wasn't successful if `currentSetup` is `null` and an error occurred. `null` if no error occurred.
  5606. ### Class Methods
  5607. #### ScriptingDefineSymbolPredicateInfo/2
  5608. > `public ScriptingDefineSymbolPredicateInfo(SDK_ScriptingDefineSymbolPredicateAttribute attribute, MethodInfo methodInfo)`
  5609. * Parameters
  5610. * `SDK_ScriptingDefineSymbolPredicateAttribute attribute` - The predicate attribute.
  5611. * `MethodInfo methodInfo` - The method info of the method the attribute is defined on.
  5612. * Returns
  5613. * _none_
  5614. Event Payload. Constructs a new instance with the specified predicate attribute and associated method info.
  5615. #### ValidInstance/0
  5616. > `public static bool ValidInstance()`
  5617. * Parameters
  5618. * _none_
  5619. * Returns
  5620. * `bool` - Returns `true` if the SDK Manager instance is valid or returns `false` if it is null.
  5621. The ValidInstance method returns whether the SDK Manager isntance is valid (i.e. it's not null).
  5622. #### AttemptAddBehaviourToToggleOnLoadedSetupChange/1
  5623. > `public static bool AttemptAddBehaviourToToggleOnLoadedSetupChange(Behaviour givenBehaviour)`
  5624. * Parameters
  5625. * `Behaviour givenBehaviour` - The behaviour to add.
  5626. * Returns
  5627. * `bool` - Returns `true` if the SDK Manager instance was valid.
  5628. The AttemptAddBehaviourToToggleOnLoadedSetupChange method will attempt to add the given behaviour to the loaded setup change toggle if the SDK Manager instance exists. If it doesn't exist then it adds it to the `delayedToggleBehaviours` HashSet to be manually added later with the `ProcessDelayedToggleBehaviours` method.
  5629. #### AttemptRemoveBehaviourToToggleOnLoadedSetupChange/1
  5630. > `public static bool AttemptRemoveBehaviourToToggleOnLoadedSetupChange(Behaviour givenBehaviour)`
  5631. * Parameters
  5632. * `Behaviour givenBehaviour` - The behaviour to remove.
  5633. * Returns
  5634. * `bool` - Returns `true` if the SDK Manager instance was valid.
  5635. The AttemptRemoveBehaviourToToggleOnLoadedSetupChange method will attempt to remove the given behaviour from the loaded setup change toggle if the SDK Manager instance exists.
  5636. #### ProcessDelayedToggleBehaviours/0
  5637. > `public static void ProcessDelayedToggleBehaviours()`
  5638. * Parameters
  5639. * _none_
  5640. * Returns
  5641. * _none_
  5642. The ProcessDelayedToggleBehaviours method will attempt to addd the behaviours in the `delayedToggleBehaviours` HashSet to the loaded setup change toggle.
  5643. #### SubscribeLoadedSetupChanged/1
  5644. > `public static bool SubscribeLoadedSetupChanged(LoadedSetupChangeEventHandler callback)`
  5645. * Parameters
  5646. * `LoadedSetupChangeEventHandler callback` - The callback to register.
  5647. * Returns
  5648. * `bool` - Returns `true` if the SDK Manager instance was valid.
  5649. The SubscribeLoadedSetupChanged method attempts to register the given callback with the `LoadedSetupChanged` event.
  5650. #### UnsubscribeLoadedSetupChanged/1
  5651. > `public static bool UnsubscribeLoadedSetupChanged(LoadedSetupChangeEventHandler callback)`
  5652. * Parameters
  5653. * `LoadedSetupChangeEventHandler callback` - The callback to unregister.
  5654. * Returns
  5655. * `bool` - Returns `true` if the SDK Manager instance was valid.
  5656. The UnsubscribeLoadedSetupChanged method attempts to unregister the given callback from the `LoadedSetupChanged` event.
  5657. #### GetLoadedSDKSetup/0
  5658. > `public static VRTK_SDKSetup GetLoadedSDKSetup()`
  5659. * Parameters
  5660. * _none_
  5661. * Returns
  5662. * `VRTK_SDKSetup` - Returns `true` if the SDK Manager instance was valid.
  5663. The GetLoadedSDKSetup method returns the current loaded SDK Setup for the SDK Manager instance.
  5664. #### GetAllSDKSetups/0
  5665. > `public static VRTK_SDKSetup[] GetAllSDKSetups()`
  5666. * Parameters
  5667. * _none_
  5668. * Returns
  5669. * `VRTK_SDKSetup[]` - An SDKSetup array of all valid SDK Setups for the current SDK Manager instance. If no SDK Manager instance is found then an empty array is returned.
  5670. The GetAllSDKSetups method returns all valid SDK Setups attached to the SDK Manager instance.
  5671. #### AttemptTryLoadSDKSetup/3
  5672. > `public static bool AttemptTryLoadSDKSetup(int startIndex, bool tryToReinitialize, params VRTK_SDKSetup[] sdkSetups)`
  5673. * Parameters
  5674. * `int startIndex` - The index of the VRTK_SDKSetup to start the loading with.
  5675. * `bool tryToReinitialize` - Whether or not to retry initializing and using the currently set but unusable VR Device.
  5676. * `params VRTK_SDKSetup[] sdkSetups` - The list to try to load a VRTK_SDKSetup from.
  5677. * Returns
  5678. * `bool` - Returns `true` if the SDK Manager instance was valid.
  5679. The AttemptTryLoadSDKSetup method attempts to load a valid VRTK_SDKSetup from a list if the SDK Manager instance is valid.
  5680. #### AttemptTryLoadSDKSetupFromList/1
  5681. > `public static bool AttemptTryLoadSDKSetupFromList(bool tryUseLastLoadedSetup = true)`
  5682. * Parameters
  5683. * `bool tryUseLastLoadedSetup` - Attempt to use the last loaded setup if it's available.
  5684. * Returns
  5685. * `bool` - Returns `true` if the SDK Manager instance was valid.
  5686. The AttemptUnloadSDKSetup method tries to load a valid VRTK_SDKSetup from setups if the SDK Manager instance is valid.
  5687. #### AttemptUnloadSDKSetup/1
  5688. > `public static bool AttemptUnloadSDKSetup(bool disableVR = false)`
  5689. * Parameters
  5690. * `bool disableVR` - Whether to disable VR altogether after unloading the SDK Setup.
  5691. * Returns
  5692. * `bool` - Returns `true` if the SDK Manager instance was valid.
  5693. The AttemptUnloadSDKSetup method attempts to unload the currently loaded VRTK_SDKSetup, if there is one and if the SDK Manager instance is valid.
  5694. #### ManageScriptingDefineSymbols/2
  5695. > `public bool ManageScriptingDefineSymbols(bool ignoreAutoManageScriptDefines, bool ignoreIsActiveAndEnabled)`
  5696. * Parameters
  5697. * `bool ignoreAutoManageScriptDefines` - Whether to ignore `autoManageScriptDefines` while deciding to manage.
  5698. * `bool ignoreIsActiveAndEnabled` - Whether to ignore `Behaviour.isActiveAndEnabled` while deciding to manage.
  5699. * Returns
  5700. * `bool` - Whether the PlayerSettings' scripting define symbols were changed.
  5701. The ManageScriptingDefineSymbols method manages (i.e. adds and removes) the scripting define symbols of the PlayerSettings for the currently set SDK infos. This method is only available in the editor, so usage of the method needs to be surrounded by `#if UNITY_EDITOR` and `#endif` when used in a type that is also compiled for a standalone build.
  5702. #### ManageVRSettings/1
  5703. > `public void ManageVRSettings(bool force)`
  5704. * Parameters
  5705. * `bool force` - Whether to ignore `autoManageVRSettings` while deciding to manage.
  5706. * Returns
  5707. * _none_
  5708. The ManageVRSettings method manages (i.e. adds and removes) the VR SDKs of the PlayerSettings for the currently set SDK infos. This method is only available in the editor, so usage of the method needs to be surrounded by `#if UNITY_EDITOR` and `#endif` when used in a type that is also compiled for a standalone build.
  5709. #### AddBehaviourToToggleOnLoadedSetupChange/1
  5710. > `public void AddBehaviourToToggleOnLoadedSetupChange(Behaviour behaviour)`
  5711. * Parameters
  5712. * `Behaviour behaviour` - The behaviour to add.
  5713. * Returns
  5714. * _none_
  5715. The AddBehaviourToToggleOnLoadedSetupChange method adds a behaviour to the list of behaviours to toggle when `loadedSetup` changes.
  5716. #### RemoveBehaviourToToggleOnLoadedSetupChange/1
  5717. > `public void RemoveBehaviourToToggleOnLoadedSetupChange(Behaviour behaviour)`
  5718. * Parameters
  5719. * `Behaviour behaviour` - The behaviour to remove.
  5720. * Returns
  5721. * _none_
  5722. The RemoveBehaviourToToggleOnLoadedSetupChange method removes a behaviour of the list of behaviours to toggle when `loadedSetup` changes.
  5723. #### TryLoadSDKSetupFromList/1
  5724. > `public void TryLoadSDKSetupFromList(bool tryUseLastLoadedSetup = true)`
  5725. * Parameters
  5726. * `bool tryUseLastLoadedSetup` - Attempt to use the last loaded setup if it's available.
  5727. * Returns
  5728. * _none_
  5729. The TryLoadSDKSetupFromList method tries to load a valid VRTK_SDKSetup from setups.
  5730. #### TryLoadSDKSetup/3
  5731. > `public void TryLoadSDKSetup(int startIndex, bool tryToReinitialize, params VRTK_SDKSetup[] sdkSetups)`
  5732. * Parameters
  5733. * `int startIndex` - The index of the VRTK_SDKSetup to start the loading with.
  5734. * `bool tryToReinitialize` - Whether or not to retry initializing and using the currently set but unusable VR Device.
  5735. * `params VRTK_SDKSetup[] sdkSetups` - The list to try to load a VRTK_SDKSetup from.
  5736. * Returns
  5737. * _none_
  5738. The TryLoadSDKSetup method tries to load a valid VRTK_SDKSetup from a list. The first loadable VRTK_SDKSetup in the list will be loaded. Will fall back to disable VR if none of the provided Setups is useable.
  5739. #### SetLoadedSDKSetupToPopulateObjectReferences/1
  5740. > `public void SetLoadedSDKSetupToPopulateObjectReferences(VRTK_SDKSetup setup)`
  5741. * Parameters
  5742. * `VRTK_SDKSetup setup` - The SDK Setup to set as the loaded SDK.
  5743. * Returns
  5744. * _none_
  5745. The SetLoadedSDKSetupToPopulateObjectReferences method sets a given VRTK_SDKSetup as the loaded SDK Setup to be able to use it when populating object references in the SDK Setup. This method should only be called when not playing as it's only for populating the object references. This method is only available in the editor, so usage of the method needs to be surrounded by `#if UNITY_EDITOR` and `#endif` when used in a type that is also compiled for a standalone build.
  5746. #### UnloadSDKSetup/1
  5747. > `public void UnloadSDKSetup(bool disableVR = false)`
  5748. * Parameters
  5749. * `bool disableVR` - Whether to disable VR altogether after unloading the SDK Setup.
  5750. * Returns
  5751. * _none_
  5752. The UnloadSDKSetup method unloads the currently loaded VRTK_SDKSetup, if there is one.
  5753. ---
  5754. ## SDK Setup (VRTK_SDKSetup)
  5755. ### Overview
  5756. The SDK Setup describes a list of SDKs and game objects to use.
  5757. ### Inspector Parameters
  5758. * **Auto Populate Object References:** Determines whether the SDK object references are automatically set to the objects of the selected SDKs. If this is true populating is done whenever the selected SDKs change.
  5759. * **Actual Boundaries:** A reference to the GameObject that is the user's boundary or play area, most likely provided by the SDK's Camera Rig.
  5760. * **Actual Headset:** A reference to the GameObject that contains the VR camera, most likely provided by the SDK's Camera Rig Headset.
  5761. * **Actual Left Controller:** A reference to the GameObject that contains the SDK Left Hand Controller.
  5762. * **Actual Right Controller:** A reference to the GameObject that contains the SDK Right Hand Controller.
  5763. * **Model Alias Left Controller:** A reference to the GameObject that models for the Left Hand Controller.
  5764. * **Model Alias Right Controller:** A reference to the GameObject that models for the Right Hand Controller.
  5765. ### Class Variables
  5766. * `public VRTK_SDKInfo systemSDKInfo` - The info of the SDK to use to deal with all system actions. By setting this to `null` the fallback SDK will be used.
  5767. * `public VRTK_SDKInfo boundariesSDKInfo` - The info of the SDK to use to utilize room scale boundaries. By setting this to `null` the fallback SDK will be used.
  5768. * `public VRTK_SDKInfo headsetSDKInfo` - The info of the SDK to use to utilize the VR headset. By setting this to `null` the fallback SDK will be used.
  5769. * `public VRTK_SDKInfo controllerSDKInfo` - The info of the SDK to use to utilize the input devices. By setting this to `null` the fallback SDK will be used.
  5770. * `public SDK_BaseSystem systemSDK` - The selected system SDK.
  5771. * `public SDK_BaseBoundaries boundariesSDK` - The selected boundaries SDK.
  5772. * `public SDK_BaseHeadset headsetSDK` - The selected headset SDK.
  5773. * `public SDK_BaseController controllerSDK` - The selected controller SDK.
  5774. * `public string[] usedVRDeviceNames` - The VR device names used by the currently selected SDKs.
  5775. * `public bool isValid` - Whether it's possible to use the Setup. See `GetSimplifiedErrorDescriptions` for more info.
  5776. ### Unity Events
  5777. Adding the `VRTK_SDKSetup_UnityEvents` component to `VRTK_SDKSetup` object allows access to `UnityEvents` that will react identically to the Class Events.
  5778. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.
  5779. ### Class Methods
  5780. #### PopulateObjectReferences/1
  5781. > `public void PopulateObjectReferences(bool force)`
  5782. * Parameters
  5783. * `bool force` - Whether to ignore `autoPopulateObjectReferences` while deciding to populate.
  5784. * Returns
  5785. * _none_
  5786. The PopulateObjectReferences method populates the object references by using the currently set SDKs.
  5787. #### GetSimplifiedErrorDescriptions/0
  5788. > `public string[] GetSimplifiedErrorDescriptions()`
  5789. * Parameters
  5790. * _none_
  5791. * Returns
  5792. * `string[]` - An array of all the error descriptions. Returns an empty array if no errors are found.
  5793. The GetSimplifiedErrorDescriptions method checks the setup for errors and creates an array of error descriptions. The returned error descriptions handle the following cases for the current SDK infos: * Its type doesn't exist anymore. * It's a fallback SDK. * It doesn't have its scripting define symbols added. * It's missing its vendor SDK.Additionally the current SDK infos are checked whether they use multiple VR Devices.
  5794. #### OnLoaded/1
  5795. > `public void OnLoaded(VRTK_SDKManager sender)`
  5796. * Parameters
  5797. * `VRTK_SDKManager sender` - The SDK Manager that has loaded the SDK Setup.
  5798. * Returns
  5799. * _none_
  5800. The OnLoaded method determines when an SDK Setup has been loaded.
  5801. #### OnUnloaded/1
  5802. > `public void OnUnloaded(VRTK_SDKManager sender)`
  5803. * Parameters
  5804. * `VRTK_SDKManager sender` - The SDK Manager that has unloaded the SDK Setup.
  5805. * Returns
  5806. * _none_
  5807. The OnUnloaded method determines when an SDK Setup has been unloaded.
  5808. ---
  5809. ## SDK Info (VRTK_SDKInfo)
  5810. > extends ISerializationCallbackReceiver
  5811. ### Overview
  5812. Holds all the info necessary to describe an SDK.
  5813. ### Class Variables
  5814. * `public Type type { get private set }` - The type of the SDK.
  5815. * `public string originalTypeNameWhenFallbackIsUsed { get private set }` - The name of the type of which this SDK info was created from. This is only used if said type wasn't found.
  5816. * `public SDK_DescriptionAttribute description { get private set }` - The description of the SDK.
  5817. ### Class Methods
  5818. #### Create<BaseType, FallbackType, ActualType>/0
  5819. > `public static VRTK_SDKInfo[] Create<BaseType, FallbackType, ActualType>() where BaseType : SDK_Base where FallbackType : BaseType where ActualType : BaseType`
  5820. * Type Params
  5821. * `BaseType` - The SDK base type. Must be a subclass of SDK_Base.
  5822. * `FallbackType` - The SDK type to fall back on if problems occur. Must be a subclass of `BaseType`.
  5823. * `ActualType` - The SDK type to use. Must be a subclass of `BaseType`.
  5824. * Parameters
  5825. * _none_
  5826. * Returns
  5827. * `VRTK_SDKInfo[]` - Multiple newly created instances.
  5828. Creates new SDK infos for a type that is known at compile time.
  5829. #### Create<BaseType, FallbackType>/1
  5830. > `public static VRTK_SDKInfo[] Create<BaseType, FallbackType>(Type actualType) where BaseType : SDK_Base where FallbackType : BaseType`
  5831. * Type Params
  5832. * `BaseType` - The SDK base type. Must be a subclass of SDK_Base.
  5833. * `FallbackType` - The SDK type to fall back on if problems occur. Must be a subclass of `BaseType.
  5834. * Parameters
  5835. * `Type actualType` - The SDK type to use. Must be a subclass of `BaseType.
  5836. * Returns
  5837. * `VRTK_SDKInfo[]` - Multiple newly created instances.
  5838. Creates new SDK infos for a type.
  5839. #### VRTK_SDKInfo/1
  5840. > `public VRTK_SDKInfo(VRTK_SDKInfo infoToCopy)`
  5841. * Parameters
  5842. * `VRTK_SDKInfo infoToCopy` - The SDK info to copy.
  5843. * Returns
  5844. * _none_
  5845. Creates a new SDK info by copying an existing one.
  5846. ---
  5847. ## Device Finder (VRTK_DeviceFinder)
  5848. ### Overview
  5849. The Device Finder offers a collection of static methods that can be called to find common game devices such as the headset or controllers, or used to determine key information about the connected devices.
  5850. ### Class Variables
  5851. * `public enum Devices` - Possible devices.
  5852. * `Headset` - The headset.
  5853. * `LeftController` - The left hand controller.
  5854. * `RightController` - The right hand controller.
  5855. * `public enum Headsets` - Possible headsets
  5856. * `Unknown` - An unknown headset.
  5857. * `OculusRift` - A summary of all Oculus Rift headset versions.
  5858. * `OculusRiftCV1` - A specific version of the Oculus Rift headset, the Consumer Version 1.
  5859. * `Vive` - A summary of all HTC Vive headset versions.
  5860. * `ViveMV` - A specific version of the HTC Vive headset, the first consumer version.
  5861. * `ViveDVT` - A specific version of the HTC Vive headset, the first consumer version.
  5862. * `OculusRiftES07` - A specific version of the Oculus Rift headset, the rare ES07.
  5863. ### Class Methods
  5864. #### GetCurrentControllerType/1
  5865. > `public static SDK_BaseController.ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  5866. * Parameters
  5867. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  5868. * Returns
  5869. * `SDK_BaseController.ControllerType` - The ControllerType based on the SDK and headset being used.
  5870. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  5871. #### GetControllerIndex/1
  5872. > `public static uint GetControllerIndex(GameObject controller)`
  5873. * Parameters
  5874. * `GameObject controller` - The controller object to get the index of a controller.
  5875. * Returns
  5876. * `uint` - The index of the given controller.
  5877. The GetControllerIndex method is used to find the index of a given controller object.
  5878. #### GetControllerByIndex/2
  5879. > `public static GameObject GetControllerByIndex(uint index, bool getActual)`
  5880. * Parameters
  5881. * `uint index` - The index of the actual controller to find.
  5882. * `bool getActual` - An optional parameter that if true will return the game object that the SDK controller is attached to.
  5883. * Returns
  5884. * `GameObject` - The actual controller GameObject that matches the given index.
  5885. The GetControllerByIndex method is used to find a controller based on it's unique index.
  5886. #### GetControllerOrigin/1
  5887. > `public static Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  5888. * Parameters
  5889. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the origin for.
  5890. * Returns
  5891. * `Transform` - The transform of the controller origin or if an origin is not set then the transform parent.
  5892. The GetControllerOrigin method is used to find the controller's origin.
  5893. #### DeviceTransform/1
  5894. > `public static Transform DeviceTransform(Devices device)`
  5895. * Parameters
  5896. * `Devices device` - The Devices enum to get the transform for.
  5897. * Returns
  5898. * `Transform` - The transform for the given Devices enum.
  5899. The DeviceTransform method returns the transform for a given Devices enum.
  5900. #### GetControllerHandType/1
  5901. > `public static SDK_BaseController.ControllerHand GetControllerHandType(string hand)`
  5902. * Parameters
  5903. * `string hand` - The string representation of the hand to retrieve the type of. `left` or `right`.
  5904. * Returns
  5905. * `SDK_BaseController.ControllerHand` - A ControllerHand representing either the Left or Right hand.
  5906. The GetControllerHandType method is used for getting the enum representation of ControllerHand from a given string.
  5907. #### GetControllerHand/1
  5908. > `public static SDK_BaseController.ControllerHand GetControllerHand(GameObject controller)`
  5909. * Parameters
  5910. * `GameObject controller` - The controller game object to check the hand of.
  5911. * Returns
  5912. * `SDK_BaseController.ControllerHand` - A ControllerHand representing either the Left or Right hand.
  5913. The GetControllerHand method is used for getting the enum representation of ControllerHand for the given controller game object.
  5914. #### GetControllerLeftHand/1
  5915. > `public static GameObject GetControllerLeftHand(bool getActual = false)`
  5916. * Parameters
  5917. * `bool getActual` - An optional parameter that if true will return the game object that the SDK controller is attached to.
  5918. * Returns
  5919. * `GameObject` - The left hand controller.
  5920. The GetControllerLeftHand method retrieves the game object for the left hand controller.
  5921. #### GetControllerRightHand/1
  5922. > `public static GameObject GetControllerRightHand(bool getActual = false)`
  5923. * Parameters
  5924. * `bool getActual` - An optional parameter that if true will return the game object that the SDK controller is attached to.
  5925. * Returns
  5926. * `GameObject` - The right hand controller.
  5927. The GetControllerRightHand method retrieves the game object for the right hand controller.
  5928. #### GetControllerReferenceLeftHand/0
  5929. > `public static VRTK_ControllerReference GetControllerReferenceLeftHand()`
  5930. * Parameters
  5931. * _none_
  5932. * Returns
  5933. * `VRTK_ControllerReference` - The Controller Reference for the left hand controller.
  5934. The GetControllerReferenceLeftHand returns a Controller Reference for the left hand controller.
  5935. #### GetControllerReferenceRightHand/0
  5936. > `public static VRTK_ControllerReference GetControllerReferenceRightHand()`
  5937. * Parameters
  5938. * _none_
  5939. * Returns
  5940. * `VRTK_ControllerReference` - The Controller Reference for the right hand controller.
  5941. The GetControllerReferenceRightHand returns a Controller Reference for the right hand controller.
  5942. #### GetControllerReferenceForHand/1
  5943. > `public static VRTK_ControllerReference GetControllerReferenceForHand(SDK_BaseController.ControllerHand hand)`
  5944. * Parameters
  5945. * _none_
  5946. * Returns
  5947. * `VRTK_ControllerReference` - The Controller Reference for the given hand controller.
  5948. The GetControllerReferenceForHand returns a Controller Reference for the given hand controller.
  5949. #### IsControllerOfHand/2
  5950. > `public static bool IsControllerOfHand(GameObject checkController, SDK_BaseController.ControllerHand hand)`
  5951. * Parameters
  5952. * `GameObject checkController` - The actual controller object that is being checked.
  5953. * `SDK_BaseController.ControllerHand hand` - The representation of a hand to check if the given controller matches.
  5954. * Returns
  5955. * `bool` - Is true if the given controller matches the given hand.
  5956. The IsControllerOfHand method is used to check if a given controller game object is of the hand type provided.
  5957. #### IsControllerLeftHand/1
  5958. > `public static bool IsControllerLeftHand(GameObject checkController)`
  5959. * Parameters
  5960. * `GameObject checkController` - The controller object that is being checked.
  5961. * Returns
  5962. * `bool` - Is true if the given controller is the left controller.
  5963. The IsControllerLeftHand method is used to check if a given controller game object is the left handed controller.
  5964. #### IsControllerRightHand/1
  5965. > `public static bool IsControllerRightHand(GameObject checkController)`
  5966. * Parameters
  5967. * `GameObject checkController` - The controller object that is being checked.
  5968. * Returns
  5969. * `bool` - Is true if the given controller is the right controller.
  5970. The IsControllerRightHand method is used to check if a given controller game object is the right handed controller.
  5971. #### GetOppositeHand/1
  5972. > `public static SDK_BaseController.ControllerHand GetOppositeHand(SDK_BaseController.ControllerHand currentHand)`
  5973. * Parameters
  5974. * `SDK_BaseController.ControllerHand currentHand` - The current hand.
  5975. * Returns
  5976. * `SDK_BaseController.ControllerHand` - The opposite hand.
  5977. The GetOppositeHand method returns the other hand type from the current hand given.
  5978. #### GetActualController/1
  5979. > `public static GameObject GetActualController(GameObject givenController)`
  5980. * Parameters
  5981. * `GameObject givenController` - The GameObject of the controller.
  5982. * Returns
  5983. * `GameObject` - The GameObject that is the actual controller.
  5984. The GetActualController method will attempt to get the actual SDK controller object.
  5985. #### GetScriptAliasController/1
  5986. > `public static GameObject GetScriptAliasController(GameObject givenController)`
  5987. * Parameters
  5988. * `GameObject givenController` - The GameObject of the controller.
  5989. * Returns
  5990. * `GameObject` - The GameObject that is the alias controller containing the scripts.
  5991. The GetScriptAliasController method will attempt to get the object that contains the scripts for the controller.
  5992. #### GetModelAliasController/1
  5993. > `public static GameObject GetModelAliasController(GameObject givenController)`
  5994. * Parameters
  5995. * `GameObject givenController` - The GameObject of the controller.
  5996. * Returns
  5997. * `GameObject` - The GameObject that is the alias controller containing the controller model.
  5998. The GetModelAliasController method will attempt to get the object that contains the model for the controller.
  5999. #### GetModelAliasControllerHand/1
  6000. > `public static SDK_BaseController.ControllerHand GetModelAliasControllerHand(GameObject givenObject)`
  6001. * Parameters
  6002. * `GameObject givenObject` - The GameObject that may represent a model alias.
  6003. * Returns
  6004. * `SDK_BaseController.ControllerHand` - The enum of the ControllerHand that the given GameObject may represent.
  6005. The GetModelAliasControllerHand method will return the hand that the given model alias GameObject is for.
  6006. #### GetControllerVelocity/1
  6007. > `public static Vector3 GetControllerVelocity(VRTK_ControllerReference controllerReference)`
  6008. * Parameters
  6009. * `VRTK_ControllerReference controllerReference` - The reference to the controller.
  6010. * Returns
  6011. * `Vector3` - A 3 dimensional vector containing the current real world physical controller velocity.
  6012. The GetControllerVelocity method is used for getting the current velocity of the physical game controller. This can be useful to determine the speed at which the controller is being swung or the direction it is being moved in.
  6013. #### GetControllerAngularVelocity/1
  6014. > `public static Vector3 GetControllerAngularVelocity(VRTK_ControllerReference controllerReference)`
  6015. * Parameters
  6016. * `VRTK_ControllerReference controllerReference` - The reference to the controller.
  6017. * Returns
  6018. * `Vector3` - A 3 dimensional vector containing the current real world physical controller angular (rotational) velocity.
  6019. The GetControllerAngularVelocity method is used for getting the current rotational velocity of the physical game controller. This can be useful for determining which way the controller is being rotated and at what speed the rotation is occurring.
  6020. #### GetHeadsetVelocity/0
  6021. > `public static Vector3 GetHeadsetVelocity()`
  6022. * Parameters
  6023. * _none_
  6024. * Returns
  6025. * `Vector3` - A Vector3 containing the current velocity of the headset.
  6026. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  6027. #### GetHeadsetAngularVelocity/0
  6028. > `public static Vector3 GetHeadsetAngularVelocity()`
  6029. * Parameters
  6030. * _none_
  6031. * Returns
  6032. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  6033. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  6034. #### HeadsetTransform/0
  6035. > `public static Transform HeadsetTransform()`
  6036. * Parameters
  6037. * _none_
  6038. * Returns
  6039. * `Transform` - The transform of the VR Headset component.
  6040. The HeadsetTransform method is used to retrieve the transform for the VR Headset in the scene. It can be useful to determine the position of the user's head in the game world.
  6041. #### HeadsetCamera/0
  6042. > `public static Transform HeadsetCamera()`
  6043. * Parameters
  6044. * _none_
  6045. * Returns
  6046. * `Transform` - The transform of the VR Camera component.
  6047. The HeadsetCamera method is used to retrieve the transform for the VR Camera in the scene.
  6048. #### GetHeadsetTypeAsString/0
  6049. > `public static string GetHeadsetTypeAsString()`
  6050. * Parameters
  6051. * _none_
  6052. * Returns
  6053. * `string` - The string of the headset connected.
  6054. The GetHeadsetTypeAsString method returns a string representing the type of headset connected.
  6055. #### GetHeadsetType/0
  6056. > `public static SDK_BaseHeadset.HeadsetType GetHeadsetType()`
  6057. * Parameters
  6058. * _none_
  6059. * Returns
  6060. * `SDK_BaseHeadset.HeadsetType` - The Headset type that is connected.
  6061. The GetHeadsetType method returns the type of headset currently connected.
  6062. #### PlayAreaTransform/0
  6063. > `public static Transform PlayAreaTransform()`
  6064. * Parameters
  6065. * _none_
  6066. * Returns
  6067. * `Transform` - The transform of the VR Play Area component.
  6068. The PlayAreaTransform method is used to retrieve the transform for the play area in the scene.
  6069. ---
  6070. ## Shared Methods (VRTK_SharedMethods)
  6071. ### Overview
  6072. The Shared Methods script is a collection of reusable static methods that are used across a range of different scripts.
  6073. ### Class Methods
  6074. #### GetBounds/3
  6075. > `public static Bounds GetBounds(Transform transform, Transform excludeRotation = null, Transform excludeTransform = null)`
  6076. * Parameters
  6077. * `Transform transform` -
  6078. * `Transform excludeRotation` - Resets the rotation of the transform temporarily to 0 to eliminate skewed bounds.
  6079. * `Transform excludeTransform` - Does not consider the stated object when calculating the bounds.
  6080. * Returns
  6081. * `Bounds` - The bounds of the transform.
  6082. The GetBounds methods returns the bounds of the transform including all children in world space.
  6083. #### IsLowest/2
  6084. > `public static bool IsLowest(float value, float[] others)`
  6085. * Parameters
  6086. * `float value` - The value to check to see if it is lowest.
  6087. * `float[] others` - The array of values to check against.
  6088. * Returns
  6089. * `bool` - Returns true if the value is lower than all numbers in the given array, returns false if it is not the lowest.
  6090. The IsLowest method checks to see if the given value is the lowest number in the given array of values.
  6091. #### AddCameraFade/0
  6092. > `public static Transform AddCameraFade()`
  6093. * Parameters
  6094. * _none_
  6095. * Returns
  6096. * `Transform` - The transform of the headset camera.
  6097. The AddCameraFade method finds the headset camera and adds a headset fade script to it.
  6098. #### CreateColliders/1
  6099. > `public static void CreateColliders(GameObject obj)`
  6100. * Parameters
  6101. * `GameObject obj` - The game object to attempt to add the colliders to.
  6102. * Returns
  6103. * _none_
  6104. The CreateColliders method attempts to add box colliders to all child objects in the given object that have a renderer but no collider.
  6105. #### ColliderExclude/2
  6106. > `public static Collider[] ColliderExclude(Collider[] setA, Collider[] setB)`
  6107. * Parameters
  6108. * `Collider[] setA` - The array that contains all of the relevant colliders.
  6109. * `Collider[] setB` - The array that contains the colliders to remove from setA.
  6110. * Returns
  6111. * `Collider[]` - A Collider array that is a subset of setA that doesn't contain the colliders from setB.
  6112. The ColliderExclude method reduces the colliders in the setA array by those matched in the setB array.
  6113. #### GetCollidersInGameObjects/3
  6114. > `public static Collider[] GetCollidersInGameObjects(GameObject[] gameObjects, bool searchChildren, bool includeInactive)`
  6115. * Parameters
  6116. * `GameObject[] gameObjects` - An array of GameObjects to get the colliders for.
  6117. * `bool searchChildren` - If this is `true` then the given GameObjects will also have their child GameObjects searched for colliders.
  6118. * `bool includeInactive` - If this is `true` then the inactive GameObjects in the array will also be checked for Colliders. Only relevant if `searchChildren` is `true`.
  6119. * Returns
  6120. * `Collider[]` - An array of Colliders that are found in the given GameObject array.
  6121. The GetCollidersInGameObjects method iterates through a GameObject array and returns all of the unique found colliders for all GameObejcts.
  6122. #### CloneComponent/3
  6123. > `public static Component CloneComponent(Component source, GameObject destination, bool copyProperties = false)`
  6124. * Parameters
  6125. * `Component source` - The component to copy.
  6126. * `GameObject destination` - The game object to copy the component to.
  6127. * `bool copyProperties` - Determines whether the properties of the component as well as the fields should be copied.
  6128. * Returns
  6129. * `Component` - The component that has been cloned onto the given game object.
  6130. The CloneComponent method takes a source component and copies it to the given destination game object.
  6131. #### ColorDarken/2
  6132. > `public static Color ColorDarken(Color color, float percent)`
  6133. * Parameters
  6134. * `Color color` - The source colour to apply the darken to.
  6135. * `float percent` - The percent to darken the colour by.
  6136. * Returns
  6137. * `Color` - The new colour with the darken applied.
  6138. The ColorDarken method takes a given colour and darkens it by the given percentage.
  6139. #### RoundFloat/3
  6140. > `public static float RoundFloat(float givenFloat, int decimalPlaces, bool rawFidelity = false)`
  6141. * Parameters
  6142. * `float givenFloat` - The float to round.
  6143. * `int decimalPlaces` - The number of decimal places to round to.
  6144. * `bool rawFidelity` - If this is true then the decimal places must be given in the decimal multiplier, e.g. 10 for 1dp, 100 for 2dp, etc.
  6145. * Returns
  6146. * `float` - The rounded float.
  6147. The RoundFloat method is used to round a given float to the given decimal places.
  6148. #### IsEditTime/0
  6149. > `public static bool IsEditTime()`
  6150. * Parameters
  6151. * _none_
  6152. * Returns
  6153. * `bool` - Returns true if Unity is in the Unity Editor and not in play mode.
  6154. The IsEditTime method determines if the state of Unity is in the Unity Editor and the scene is not in play mode.
  6155. #### Mod/2
  6156. > `public static float Mod(float a, float b)`
  6157. * Parameters
  6158. * `float a` - The dividend value.
  6159. * `float b` - The divisor value.
  6160. * Returns
  6161. * `float` - The remainder value.
  6162. The Mod method is used to find the remainder of the sum a/b.
  6163. #### FindEvenInactiveGameObject<T>/2
  6164. > `public static GameObject FindEvenInactiveGameObject<T>(string gameObjectName = null, bool searchAllScenes = false) where T : Component`
  6165. * Type Params
  6166. * `T` - The component type that needs to be on an ancestor of the wanted GameObject. Must be a subclass of `Component`.
  6167. * Parameters
  6168. * `string gameObjectName` - The name of the wanted GameObject. If it contains a '/' character, this method traverses the hierarchy like a path name, beginning on the game object that has a component of type `T`.
  6169. * `bool searchAllScenes` - If this is true, all loaded scenes will be searched. If this is false, only the active scene will be searched.
  6170. * Returns
  6171. * `GameObject` - The GameObject with name `gameObjectName` and an ancestor that has a `T`. If no such GameObject is found then `null` is returned.
  6172. Finds the first GameObject with a given name and an ancestor that has a specific component. This method returns active as well as inactive GameObjects in all scenes. It doesn't return assets. For performance reasons it is recommended to not use this function every frame. Cache the result in a member variable at startup instead.
  6173. #### FindEvenInactiveComponents<T>/1
  6174. > `public static T[] FindEvenInactiveComponents<T>(bool searchAllScenes = false) where T : Component`
  6175. * Type Params
  6176. * `T` - The component type to search for. Must be a subclass of `Component`.
  6177. * Parameters
  6178. * `bool searchAllScenes` - If this is true, all loaded scenes will be searched. If this is false, only the active scene will be searched.
  6179. * Returns
  6180. * `T[]` - All the found components. If no component is found an empty array is returned.
  6181. Finds all components of a given type. This method returns components from active as well as inactive GameObjects in all scenes. It doesn't return assets. For performance reasons it is recommended to not use this function every frame. Cache the result in a member variable at startup instead.
  6182. #### FindEvenInactiveComponent<T>/1
  6183. > `public static T FindEvenInactiveComponent<T>(bool searchAllScenes = false) where T : Component`
  6184. * Type Params
  6185. * `T` - The component type to search for. Must be a subclass of `Component`.
  6186. * Parameters
  6187. * `bool searchAllScenes` - If this is true, all loaded scenes will be searched. If this is false, only the active scene will be searched.
  6188. * Returns
  6189. * `T` - The found component. If no component is found `null` is returned.
  6190. Finds the first component of a given type. This method returns components from active as well as inactive GameObjects in all scenes. It doesn't return assets. For performance reasons it is recommended to not use this function every frame. Cache the result in a member variable at startup instead.
  6191. #### GenerateVRTKObjectName/2
  6192. > `public static string GenerateVRTKObjectName(bool autoGen, params object[] replacements)`
  6193. * Parameters
  6194. * `bool autoGen` - An additiona [AUTOGEN] prefix will be added if this is true.
  6195. * `params object[] replacements` - A collection of parameters to add to the generated name.
  6196. * Returns
  6197. * `string` - The generated name string.
  6198. The GenerateVRTKObjectName method is used to create a standard name string for any VRTK generated object.
  6199. #### GetGPUTimeLastFrame/0
  6200. > `public static float GetGPUTimeLastFrame()`
  6201. * Parameters
  6202. * _none_
  6203. * Returns
  6204. * `float` - The total GPU time utilized last frame as measured by the VR subsystem.
  6205. The GetGPUTimeLastFrame retrieves the time spent by the GPU last frame, in seconds, as reported by the VR SDK.
  6206. #### Vector2ShallowCompare/3
  6207. > `public static bool Vector2ShallowCompare(Vector2 vectorA, Vector2 vectorB, int compareFidelity)`
  6208. * Parameters
  6209. * `Vector2 vectorA` - The Vector2 to compare against.
  6210. * `Vector2 vectorB` - The Vector2 to compare with
  6211. * `int compareFidelity` - The number of decimal places to use when doing the comparison on the float elements within the Vector2.
  6212. * Returns
  6213. * `bool` - Returns `true` if the given Vector2 objects match based on the given fidelity.
  6214. The Vector2ShallowCompare method compares two given Vector2 objects based on the given fidelity, which is the equivalent of comparing rounded Vector2 elements to determine if the Vector2 elements are equal.
  6215. #### Vector3ShallowCompare/3
  6216. > `public static bool Vector3ShallowCompare(Vector3 vectorA, Vector3 vectorB, float threshold)`
  6217. * Parameters
  6218. * `Vector3 vectorA` - The Vector3 to compare against.
  6219. * `Vector3 vectorB` - The Vector3 to compare with
  6220. * `float threshold` - The distance in which the two Vector3 objects can be within to be considered true
  6221. * Returns
  6222. * `bool` - Returns `true` if the given Vector3 objects are within the given threshold distance.
  6223. The Vector3ShallowCompare method compares two given Vector3 objects based on the given threshold, which is the equavelent of checking the distance between two Vector3 objects are above the threshold distance.
  6224. #### NumberPercent/2
  6225. > `public static float NumberPercent(float value, float percent)`
  6226. * Parameters
  6227. * `float value` - The value to determine the percentage from
  6228. * `float percent` - The percentage to find within the given value.
  6229. * Returns
  6230. * `float` - A float containing the percentage value based on the given input.
  6231. The NumberPercent method is used to determine the percentage of a given value.
  6232. #### SetGlobalScale/2
  6233. > `public static void SetGlobalScale(this Transform transform, Vector3 globalScale)`
  6234. * Parameters
  6235. * `this Transform transform` - The reference to the transform to scale.
  6236. * `Vector3 globalScale` - A Vector3 of a global scale to apply to the given transform.
  6237. * Returns
  6238. * _none_
  6239. The SetGlobalScale method is used to set a transform scale based on a global scale instead of a local scale.
  6240. #### VectorHeading/2
  6241. > `public static Vector3 VectorHeading(Vector3 originPosition, Vector3 targetPosition)`
  6242. * Parameters
  6243. * `Vector3 originPosition` - The point to use as the originating position for the heading calculation.
  6244. * `Vector3 targetPosition` - The point to use as the target position for the heading calculation.
  6245. * Returns
  6246. * `Vector3` - A Vector3 containing the heading changes of the target position in relation to the origin position.
  6247. The VectorHeading method calculates the current heading of the target position in relation to the origin position.
  6248. #### VectorDirection/2
  6249. > `public static Vector3 VectorDirection(Vector3 originPosition, Vector3 targetPosition)`
  6250. * Parameters
  6251. * `Vector3 originPosition` - The point to use as the originating position for the direction calculation.
  6252. * `Vector3 targetPosition` - The point to use as the target position for the direction calculation.
  6253. * Returns
  6254. * `Vector3` - A Vector3 containing the direction of the target position in relation to the origin position.
  6255. The VectorDirection method calculates the direction the target position is in relation to the origin position.
  6256. #### DividerToMultiplier/1
  6257. > `public static float DividerToMultiplier(float value)`
  6258. * Parameters
  6259. * `float value` - The number to convert into the multplier value.
  6260. * Returns
  6261. * `float` - The calculated number that can replace the divider number in a multiplication sum.
  6262. The DividerToMultiplier method takes a number to be used in a division and converts it to be used for multiplication. (e.g. 2 / 2 becomes 2 * 0.5)
  6263. #### NormalizeValue/4
  6264. > `public static float NormalizeValue(float value, float minValue, float maxValue, float threshold = 0f)`
  6265. * Parameters
  6266. * `float value` - The actual value to normalize.
  6267. * `float minValue` - The minimum value the actual value can be.
  6268. * `float maxValue` - The maximum value the actual value can be.
  6269. * `float threshold` - The threshold to force to the minimum or maximum value if the normalized value is within the threhold limits.
  6270. * Returns
  6271. * `float` -
  6272. The NormalizeValue method takes a given value between a specified range and returns the normalized value between 0f and 1f.
  6273. #### AxisDirection/2
  6274. > `public static Vector3 AxisDirection(int axisIndex, Transform givenTransform = null)`
  6275. * Parameters
  6276. * `int axisIndex` - The axis index of the axis. `0 = x` `1 = y` `2 = z`
  6277. * `Transform givenTransform` - An optional Transform to get the Axis Direction for. If this is `null` then the World directions will be used.
  6278. * Returns
  6279. * `Vector3` - The direction Vector3 based on the given axis index.
  6280. The AxisDirection method returns the relevant direction Vector3 based on the axis index in relation to x,y,z.
  6281. #### AddListValue<TValue>/3
  6282. > `public static bool AddListValue<TValue>(List<TValue> list, TValue value, bool preventDuplicates = false)`
  6283. * Type Params
  6284. * `TValue` - The datatype for the list value.
  6285. * Parameters
  6286. * `List<TValue> list` - The list to retrieve the value from.
  6287. * `TValue value` - The value to attempt to add to the list.
  6288. * `bool preventDuplicates` - If this is `false` then the value provided will always be appended to the list. If this is `true` the value provided will only be added to the list if it doesn't already exist.
  6289. * Returns
  6290. * `bool` - Returns `true` if the given value was successfully added to the list. Returns `false` if the given value already existed in the list and `preventDuplicates` is `true`.
  6291. The AddListValue method adds the given value to the given list. If `preventDuplicates` is `true` then the given value will only be added if it doesn't already exist in the given list.
  6292. #### GetDictionaryValue<TKey, TValue>/4
  6293. > `public static TValue GetDictionaryValue<TKey, TValue>(Dictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue = default(TValue), bool setMissingKey = false)`
  6294. * Type Params
  6295. * `TKey` - The datatype for the dictionary key.
  6296. * `TValue` - The datatype for the dictionary value.
  6297. * Parameters
  6298. * `Dictionary<TKey, TValue> dictionary` - The dictionary to retrieve the value from.
  6299. * `TKey key` - The key to retrieve the value for.
  6300. * `TValue defaultValue` - The value to utilise when either setting the missing key (if `setMissingKey` is `true`) or the default value to return when no key is found (if `setMissingKey` is `false`).
  6301. * `bool setMissingKey` - If this is `true` and the given key is not present, then the dictionary value for the given key will be set to the `defaultValue` parameter. If this is `false` and the given key is not present then the `defaultValue` parameter will be returned as the value.
  6302. * Returns
  6303. * `TValue` - The found value for the given key in the given dictionary, or the default value if no key is found.
  6304. The GetDictionaryValue method attempts to retrieve a value from a given dictionary for the given key. It removes the need for a double dictionary lookup to ensure the key is valid and has the option of also setting the missing key value to ensure the dictionary entry is valid.
  6305. #### GetDictionaryValue<TKey, TValue>/5
  6306. > `public static TValue GetDictionaryValue<TKey, TValue>(Dictionary<TKey, TValue> dictionary, TKey key, out bool keyExists, TValue defaultValue = default(TValue), bool setMissingKey = false)`
  6307. * Type Params
  6308. * `TKey` - The datatype for the dictionary key.
  6309. * `TValue` - The datatype for the dictionary value.
  6310. * Parameters
  6311. * `Dictionary<TKey, TValue> dictionary` - The dictionary to retrieve the value from.
  6312. * `TKey key` - The key to retrieve the value for.
  6313. * `out bool keyExists` - Sets the given parameter to `true` if the key exists in the given dictionary or sets to `false` if the key didn't existing in the given dictionary.
  6314. * `TValue defaultValue` - The value to utilise when either setting the missing key (if `setMissingKey` is `true`) or the default value to return when no key is found (if `setMissingKey` is `false`).
  6315. * `bool setMissingKey` - If this is `true` and the given key is not present, then the dictionary value for the given key will be set to the `defaultValue` parameter. If this is `false` and the given key is not present then the `defaultValue` parameter will be returned as the value.
  6316. * Returns
  6317. * `TValue` - The found value for the given key in the given dictionary, or the default value if no key is found.
  6318. The GetDictionaryValue method attempts to retrieve a value from a given dictionary for the given key. It removes the need for a double dictionary lookup to ensure the key is valid and has the option of also setting the missing key value to ensure the dictionary entry is valid.
  6319. #### AddDictionaryValue<TKey, TValue>/4
  6320. > `public static bool AddDictionaryValue<TKey, TValue>(Dictionary<TKey, TValue> dictionary, TKey key, TValue value, bool overwriteExisting = false)`
  6321. * Type Params
  6322. * `TKey` - The datatype for the dictionary key.
  6323. * `TValue` - The datatype for the dictionary value.
  6324. * Parameters
  6325. * `Dictionary<TKey, TValue> dictionary` - The dictionary to set the value for.
  6326. * `TKey key` - The key to set the value for.
  6327. * `TValue value` - The value to set at the given key in the given dictionary.
  6328. * `bool overwriteExisting` - If this is `true` then the value for the given key will always be set to the provided value. If this is `false` then the value for the given key will only be set if the given key is not found in the given dictionary.
  6329. * Returns
  6330. * `bool` - Returns `true` if the given value was successfully added to the dictionary at the given key. Returns `false` if the given key already existed in the dictionary and `overwriteExisting` is `false`.
  6331. The AddDictionaryValue method attempts to add a value for the given key in the given dictionary if the key does not already exist. If `overwriteExisting` is `true` then it always set the value even if they key exists.
  6332. #### GetTypeUnknownAssembly/1
  6333. > `public static Type GetTypeUnknownAssembly(string typeName)`
  6334. * Parameters
  6335. * `string typeName` - The name of the type to get.
  6336. * Returns
  6337. * `Type` - The Type, or null if none is found.
  6338. The GetTypeUnknownAssembly method is used to find a Type without knowing the exact assembly it is in.
  6339. #### GetEyeTextureResolutionScale/0
  6340. > `public static float GetEyeTextureResolutionScale()`
  6341. * Parameters
  6342. * _none_
  6343. * Returns
  6344. * `float` - Returns a float with the render scale for the resolution.
  6345. The GetEyeTextureResolutionScale method returns the render scale for the resolution.
  6346. #### SetEyeTextureResolutionScale/1
  6347. > `public static void SetEyeTextureResolutionScale(float value)`
  6348. * Parameters
  6349. * `float value` - The value to set the render scale to.
  6350. * Returns
  6351. * _none_
  6352. The SetEyeTextureResolutionScale method sets the render scale for the resolution.
  6353. #### IsTypeSubclassOf/2
  6354. > `public static bool IsTypeSubclassOf(Type givenType, Type givenBaseType)`
  6355. * Parameters
  6356. * `Type givenType` - The Type to check.
  6357. * `Type givenBaseType` - The base Type to check.
  6358. * Returns
  6359. * `bool` - Returns `true` if the given type is a subclass of the given base type.
  6360. The IsTypeSubclassOf checks if a given Type is a subclass of another given Type.
  6361. #### GetTypeCustomAttributes/3
  6362. > `public static object[] GetTypeCustomAttributes(Type givenType, Type attributeType, bool inherit)`
  6363. * Parameters
  6364. * `Type givenType` - The type to get the custom attributes for.
  6365. * `Type attributeType` - The attribute type.
  6366. * `bool inherit` - Whether to inherit attributes.
  6367. * Returns
  6368. * `object[]` - Returns an object array of custom attributes.
  6369. The GetTypeCustomAttributes method gets the custom attributes of a given type.
  6370. #### GetBaseType/1
  6371. > `public static Type GetBaseType(Type givenType)`
  6372. * Parameters
  6373. * `Type givenType` - The type to return the base Type for.
  6374. * Returns
  6375. * `Type` - Returns the base Type.
  6376. The GetBaseType method returns the base Type for the given Type.
  6377. #### IsTypeAssignableFrom/2
  6378. > `public static bool IsTypeAssignableFrom(Type givenType, Type sourceType)`
  6379. * Parameters
  6380. * `Type givenType` - The Type to check on.
  6381. * `Type sourceType` - The Type to check if the given Type is assignable from.
  6382. * Returns
  6383. * `bool` - Returns `true` if the given Type is assignable from the source Type.
  6384. The IsTypeAssignableFrom method determines if the given Type is assignable from the source Type.
  6385. #### GetNestedType/2
  6386. > `public static Type GetNestedType(Type givenType, string name)`
  6387. * Parameters
  6388. * `Type givenType` - The Type to check on.
  6389. * `string name` - The name of the nested Type.
  6390. * Returns
  6391. * `Type` - Returns the nested Type.
  6392. The GetNestedType method returns the nested Type of the given Type.
  6393. #### GetPropertyFirstName<T>/0
  6394. > `public static string GetPropertyFirstName<T>()`
  6395. * Type Params
  6396. * `T` - The type to check the first property on.
  6397. * Parameters
  6398. * _none_
  6399. * Returns
  6400. * `string` - Returns a string representation of the first property name for the given Type.
  6401. The GetPropertyFirstName method returns the string name of the first property on a given Type.
  6402. #### GetCommandLineArguements/0
  6403. > `public static string[] GetCommandLineArguements()`
  6404. * Parameters
  6405. * _none_
  6406. * Returns
  6407. * `string[]` - Returns an array of command line arguements as strings.
  6408. The GetCommandLineArguements method returns the command line arguements for the environment.
  6409. #### GetTypesOfType/1
  6410. > `public static Type[] GetTypesOfType(Type givenType)`
  6411. * Parameters
  6412. * `Type givenType` - The Type to check on.
  6413. * Returns
  6414. * `Type[]` - An array of Types found.
  6415. The GetTypesOfType method returns an array of Types for the given Type.
  6416. #### GetExportedTypesOfType/1
  6417. > `public static Type[] GetExportedTypesOfType(Type givenType)`
  6418. * Parameters
  6419. * `Type givenType` - The Type to check on.
  6420. * Returns
  6421. * `Type[]` - An array of Exported Types found.
  6422. The GetExportedTypesOfType method returns an array of Exported Types for the given Type.
  6423. #### IsTypeAbstract/1
  6424. > `public static bool IsTypeAbstract(Type givenType)`
  6425. * Parameters
  6426. * `Type givenType` - The Type to check on.
  6427. * Returns
  6428. * `bool` - Returns `true` if the given type is abstract.
  6429. The IsTypeAbstract method determines if a given Type is abstract.
  6430. ---
  6431. ## Policy List (VRTK_PolicyList)
  6432. ### Overview
  6433. The Policy List allows to create a list of either tag names, script names or layer names that can be checked against to see if another operation is permitted.
  6434. A number of other scripts can use a Policy List to determine if an operation is permitted based on whether a game object has a tag applied, a script component on it or whether it's on a given layer.
  6435. For example, the Teleporter scripts can ignore game object targets as a teleport location if the game object contains a tag that is in the identifiers list and the policy is set to ignore.
  6436. Or the teleporter can only allow teleport to targets that contain a tag that is in the identifiers list and the policy is set to include.
  6437. Add the Policy List script to a game object (preferably the same component utilising the list) and then configure the list accordingly.
  6438. Then in the component that has a Policy List paramter (e.g. BasicTeleporter has `Target List Policy`) simply select the list that has been created and defined.
  6439. ### Inspector Parameters
  6440. * **Operation:** The operation to apply on the list of identifiers.
  6441. * **Check Type:** The element type on the game object to check against.
  6442. * **Identifiers:** A list of identifiers to check for against the given check type (either tag or script).
  6443. ### Class Variables
  6444. * `public enum OperationTypes` - The operation to apply on the list of identifiers.
  6445. * `Ignore` - Will ignore any game objects that contain either a tag or script component that is included in the identifiers list.
  6446. * `Include` - Will only include game objects that contain either a tag or script component that is included in the identifiers list.
  6447. * `public enum CheckTypes` - The types of element that can be checked against.
  6448. * `Tag = 1` - The tag applied to the game object.
  6449. * `Script = 2` - A script component added to the game object.
  6450. * `Layer = 4` - A layer applied to the game object.
  6451. ### Class Methods
  6452. #### Find/1
  6453. > `public virtual bool Find(GameObject obj)`
  6454. * Parameters
  6455. * `GameObject obj` - The game object to check if it has a tag or script that is listed in the identifiers list.
  6456. * Returns
  6457. * `bool` - If the operation is `Ignore` and the game object is matched by an identifier from the list then it returns true. If the operation is `Include` and the game object is not matched by an identifier from the list then it returns true.
  6458. The Find method performs the set operation to determine if the given game object contains one of the identifiers on the set check type. For instance, if the Operation is `Ignore` and the Check Type is `Tag` then the Find method will attempt to see if the given game object has a tag that matches one of the identifiers.
  6459. #### Check/2
  6460. > `public static bool Check(GameObject obj, VRTK_PolicyList list)`
  6461. * Parameters
  6462. * `GameObject obj` - The game object to check.
  6463. * `VRTK_PolicyList list` - The policy list to use for checking.
  6464. * Returns
  6465. * `bool` - Returns true of the given game object matches the policy list or given string logic.
  6466. The Check method is used to check if a game object should be ignored based on a given string or policy list.
  6467. ---
  6468. ## Custom Raycast (VRTK_CustomRaycast)
  6469. ### Overview
  6470. A Custom Raycast allows to specify custom options for a Physics.Raycast.
  6471. A number of other scripts can utilise a Custom Raycast to further customise the raycasts that the scripts use internally.
  6472. For example, the VRTK_BodyPhysics script can be set to ignore trigger colliders when casting to see if it should teleport up or down to the nearest floor.
  6473. ### Inspector Parameters
  6474. * **Layers To Ignore:** The layers to ignore when raycasting.
  6475. * **Trigger Interaction:** Determines whether the ray will interact with trigger colliders.
  6476. ### Class Methods
  6477. #### Raycast/6
  6478. > `public static bool Raycast(VRTK_CustomRaycast customCast, Ray ray, out RaycastHit hitData, LayerMask ignoreLayers, float length = Mathf.Infinity, QueryTriggerInteraction affectTriggers = QueryTriggerInteraction.UseGlobal)`
  6479. * Parameters
  6480. * `VRTK_CustomRaycast customCast` - The optional object with customised cast parameters.
  6481. * `Ray ray` - The Ray to cast with.
  6482. * `out RaycastHit hitData` - The raycast hit data.
  6483. * `LayerMask ignoreLayers` - A layermask of layers to ignore from the raycast.
  6484. * `float length` - The maximum length of the raycast.
  6485. * `QueryTriggerInteraction affectTriggers` - Determines the trigger interaction level of the cast.
  6486. * Returns
  6487. * `bool` - Returns true if the raycast successfully collides with a valid object.
  6488. The Raycast method is used to generate a raycast either from the given CustomRaycast object or a default Physics.Raycast.
  6489. #### Linecast/6
  6490. > `public static bool Linecast(VRTK_CustomRaycast customCast, Vector3 startPosition, Vector3 endPosition, out RaycastHit hitData, LayerMask ignoreLayers, QueryTriggerInteraction affectTriggers = QueryTriggerInteraction.UseGlobal)`
  6491. * Parameters
  6492. * `VRTK_CustomRaycast customCast` - The optional object with customised cast parameters.
  6493. * `Vector3 startPosition` - The world position to start the linecast from.
  6494. * `Vector3 endPosition` - The world position to end the linecast at.
  6495. * `out RaycastHit hitData` - The linecast hit data.
  6496. * `LayerMask ignoreLayers` - A layermask of layers to ignore from the linecast.
  6497. * `QueryTriggerInteraction affectTriggers` - Determines the trigger interaction level of the cast.
  6498. * Returns
  6499. * `bool` - Returns true if the linecast successfully collides with a valid object.
  6500. The Linecast method is used to generate a linecast either from the given CustomRaycast object or a default Physics.Linecast.
  6501. #### CapsuleCast/9
  6502. > `public static bool CapsuleCast(VRTK_CustomRaycast customCast, Vector3 point1, Vector3 point2, float radius, Vector3 direction, float maxDistance, out RaycastHit hitData, LayerMask ignoreLayers, QueryTriggerInteraction affectTriggers = QueryTriggerInteraction.UseGlobal)`
  6503. * Parameters
  6504. * `VRTK_CustomRaycast customCast` - The optional object with customised cast parameters.
  6505. * `Vector3 point1` - The center of the sphere at the start of the capsule.
  6506. * `Vector3 point2` - The center of the sphere at the end of the capsule.
  6507. * `float radius` - The radius of the capsule.
  6508. * `Vector3 direction` - The direction into which to sweep the capsule.
  6509. * `float maxDistance` - The max length of the sweep.
  6510. * `out RaycastHit hitData` - The capsulecast hit data.
  6511. * `LayerMask ignoreLayers` - A layermask of layers to ignore from the capsulecast.
  6512. * `QueryTriggerInteraction affectTriggers` - Determines the trigger interaction level of the cast.
  6513. * Returns
  6514. * `bool` - Returns true if the capsulecast successfully collides with a valid object.
  6515. The CapsuleCast method is used to generate a capsulecast either from the given CustomRaycast object or a default Physics.CapsuleCast.
  6516. #### BoxCast/9
  6517. > `public static bool BoxCast(VRTK_CustomRaycast customCast, Vector3 center, Vector3 halfExtents, Vector3 direction, Quaternion orientation, float maxDistance, out RaycastHit hitData, LayerMask ignoreLayers, QueryTriggerInteraction affectTriggers = QueryTriggerInteraction.UseGlobal)`
  6518. * Parameters
  6519. * `VRTK_CustomRaycast customCast` - The optional object with customised cast parameters.
  6520. * `Vector3 center` - The center of the box.
  6521. * `Vector3 halfExtents` - Half the size of the box in each dimension.
  6522. * `Vector3 direction` - The direction in which to cast the box.
  6523. * `Quaternion orientation` - The rotation of the box.
  6524. * `float maxDistance` - The max length of the cast.
  6525. * `out RaycastHit hitData` - The boxcast hit data.
  6526. * `LayerMask ignoreLayers` - A layermask of layers to ignore from the boxcast.
  6527. * `QueryTriggerInteraction affectTriggers` - Determines the trigger interaction level of the cast.
  6528. * Returns
  6529. * `bool` - Returns true if the boxcast successfully collides with a valid object.
  6530. The BoxCast method is used to generate a boxcast either from the given CustomRaycast object or a default Physics.BoxCast.
  6531. #### CustomRaycast/3
  6532. > `public virtual bool CustomRaycast(Ray ray, out RaycastHit hitData, float length = Mathf.Infinity)`
  6533. * Parameters
  6534. * `Ray ray` - The Ray to cast with.
  6535. * `out RaycastHit hitData` - The raycast hit data.
  6536. * `float length` - The maximum length of the raycast.
  6537. * Returns
  6538. * `bool` - Returns true if the raycast successfully collides with a valid object.
  6539. The CustomRaycast method is used to generate a raycast based on the options defined in the CustomRaycast object.
  6540. #### CustomLinecast/3
  6541. > `public virtual bool CustomLinecast(Vector3 startPosition, Vector3 endPosition, out RaycastHit hitData)`
  6542. * Parameters
  6543. * `Vector3 startPosition` - The world position to start the linecast from.
  6544. * `Vector3 endPosition` - The world position to end the linecast at.
  6545. * `out RaycastHit hitData` - The linecast hit data.
  6546. * Returns
  6547. * `bool` - Returns true if the line successfully collides with a valid object.
  6548. The CustomLinecast method is used to generate a linecast based on the options defined in the CustomRaycast object.
  6549. #### CustomCapsuleCast/6
  6550. > `public virtual bool CustomCapsuleCast(Vector3 point1, Vector3 point2, float radius, Vector3 direction, float maxDistance, out RaycastHit hitData)`
  6551. * Parameters
  6552. * `Vector3 point1` - The center of the sphere at the start of the capsule.
  6553. * `Vector3 point2` - The center of the sphere at the end of the capsule.
  6554. * `float radius` - The radius of the capsule.
  6555. * `Vector3 direction` - The direction into which to sweep the capsule.
  6556. * `float maxDistance` - The max length of the sweep.
  6557. * `out RaycastHit hitData` - The capsulecast hit data.
  6558. * Returns
  6559. * `bool` - Returns true if the capsule successfully collides with a valid object.
  6560. The CustomCapsuleCast method is used to generate a capsulecast based on the options defined in the CustomRaycast object.
  6561. #### CustomBoxCast/6
  6562. > `public virtual bool CustomBoxCast(Vector3 center, Vector3 halfExtents, Vector3 direction, Quaternion orientation, float maxDistance, out RaycastHit hitData)`
  6563. * Parameters
  6564. * `Vector3 center` - The center of the box.
  6565. * `Vector3 halfExtents` - Half the size of the box in each dimension.
  6566. * `Vector3 direction` - The direction in which to cast the box.
  6567. * `Quaternion orientation` - The rotation of the box.
  6568. * `float maxDistance` - The max length of the cast.
  6569. * `out RaycastHit hitData` - The boxcast hit data.
  6570. * Returns
  6571. * `bool` - Returns true if the box successfully collides with a valid object.
  6572. The CustomBoxCast method is used to generate a boxcast based on the options defined in the CustomRaycast object.
  6573. ---
  6574. ## Nav Mesh Data (VRTK_NavMeshData)
  6575. ### Overview
  6576. The Nav Mesh Data script allows custom nav mesh information to be provided to the teleporter script.
  6577. ### Inspector Parameters
  6578. * **Distance Limit:** The max distance given point can be outside the nav mesh to be considered valid.
  6579. * **Valid Areas:** The parts of the navmesh that are considered valid
  6580. ---
  6581. ## Adaptive Quality (VRTK_AdaptiveQuality)
  6582. ### Overview
  6583. Adaptive Quality dynamically changes rendering settings to maintain VR framerate while maximizing GPU utilization.
  6584. > **Only Compatible With Unity 5.4 and above**
  6585. There are two goals:
  6586. * Reduce the chances of dropping frames and reprojecting
  6587. * Increase quality when there are idle GPU cycles
  6588. This script currently changes the following to reach these goals:
  6589. * Rendering resolution and viewport size (aka Dynamic Resolution)
  6590. In the future it could be changed to also change the following:
  6591. * MSAA level
  6592. * Fixed Foveated Rendering
  6593. * Radial Density Masking
  6594. * (Non-fixed) Foveated Rendering (once HMDs support eye tracking)
  6595. Some shaders, especially Image Effects, need to be modified to work with the changed render scale. To fix them
  6596. pass `1.0f / VRSettings.renderViewportScale` into the shader and scale all incoming UV values with it in the vertex
  6597. program. Do this by using `Material.SetFloat` to set the value in the script that configures the shader.
  6598. In more detail:
  6599. * In the `.shader` file: Add a new runtime-set property value `float _InverseOfRenderViewportScale` and add `vertexInput.texcoord *= _InverseOfRenderViewportScale` to the start of the vertex program
  6600. * In the `.cs` file: Before using the material (eg. `Graphics.Blit`) add `material.SetFloat("_InverseOfRenderViewportScale", 1.0f / VRSettings.renderViewportScale)`
  6601. ### Inspector Parameters
  6602. * **Draw Debug Visualization:** Toggles whether to show the debug overlay. Each square represents a different level on the quality scale. Levels increase from left to right, the first green box that is lit above represents the recommended render target resolution provided by the current `VRDevice`, the box that is lit below in cyan represents the current resolution and the filled box represents the current viewport scale. The yellow boxes represent resolutions below the recommended render target resolution. The currently lit box becomes red whenever the user is likely seeing reprojection in the HMD since the application isn't maintaining VR framerate. If lit, the box all the way on the left is almost always lit red because it represents the lowest render scale with reprojection on.
  6603. * **Allow Keyboard Shortcuts:** Toggles whether to allow keyboard shortcuts to control this script.
  6604. * The supported shortcuts are:
  6605. * `Shift+F1`: Toggle debug visualization on/off
  6606. * `Shift+F2`: Toggle usage of override render scale on/off
  6607. * `Shift+F3`: Decrease override render scale level
  6608. * `Shift+F4`: Increase override render scale level
  6609. * **Allow Command Line Arguments:** Toggles whether to allow command line arguments to control this script at startup of the standalone build.
  6610. * The supported command line arguments all begin with '-' and are:
  6611. * `-noaq`: Disable adaptive quality
  6612. * `-aqminscale X`: Set minimum render scale to X
  6613. * `-aqmaxscale X`: Set maximum render scale to X
  6614. * `-aqmaxres X`: Set maximum render target dimension to X
  6615. * `-aqfillratestep X`: Set render scale fill rate step size in percent to X (X from 1 to 100)
  6616. * `-aqoverride X`: Set override render scale level to X
  6617. * `-vrdebug`: Enable debug visualization
  6618. * `-msaa X`: Set MSAA level to X
  6619. * **Msaa Level:** The MSAA level to use.
  6620. * **Scale Render Viewport:** Toggles whether the render viewport scale is dynamically adjusted to maintain VR framerate. If unchecked, the renderer will render at the recommended resolution provided by the current `VRDevice`.
  6621. * **Render Scale Limits:** The minimum and maximum allowed render scale.
  6622. * **Maximum Render Target Dimension:** The maximum allowed render target dimension. This puts an upper limit on the size of the render target regardless of the maximum render scale.
  6623. * **Render Scale Fill Rate Step Size In Percent:** The fill rate step size in percent by which the render scale levels will be calculated.
  6624. * **Scale Render Target Resolution:** Toggles whether the render target resolution is dynamically adjusted to maintain VR framerate. If unchecked, the renderer will use the maximum target resolution specified by `maximumRenderScale`.
  6625. * **Override Render Viewport Scale:** Toggles whether to override the used render viewport scale level.
  6626. * **Override Render Viewport Scale Level:** The render viewport scale level to override the current one with.
  6627. ### Class Variables
  6628. * `public readonly ReadOnlyCollection<float> renderScales` - All the calculated render scales. The elements of this collection are to be interpreted as modifiers to the recommended render target resolution provided by the current `VRDevice`.
  6629. * `public static float CurrentRenderScale` - The current render scale. A render scale of `1.0` represents the recommended render target resolution provided by the current `VRDevice`.
  6630. * `public Vector2 defaultRenderTargetResolution` - The recommended render target resolution provided by the current `VRDevice`.
  6631. * `public Vector2 currentRenderTargetResolution` - The current render target resolution.
  6632. ### Class Methods
  6633. #### RenderTargetResolutionForRenderScale/1
  6634. > `public static Vector2 RenderTargetResolutionForRenderScale(float renderScale)`
  6635. * Parameters
  6636. * `float renderScale` - The render scale to calculate the render target resolution with.
  6637. * Returns
  6638. * `Vector2` - The render target resolution for `renderScale`.
  6639. Calculates and returns the render target resolution for a given render scale.
  6640. #### BiggestAllowedMaximumRenderScale/0
  6641. > `public float BiggestAllowedMaximumRenderScale()`
  6642. * Parameters
  6643. * _none_
  6644. * Returns
  6645. * `float` - The biggest allowed maximum render scale.
  6646. Calculates and returns the biggest allowed maximum render scale to be used for `maximumRenderScale` given the current `maximumRenderTargetDimension`.
  6647. #### ToString/0
  6648. > `public override string ToString()`
  6649. * Parameters
  6650. * _none_
  6651. * Returns
  6652. * `string` - The summary.
  6653. A summary of this script by listing all the calculated render scales with their corresponding render target resolution.
  6654. ### Example
  6655. `VRTK/Examples/039_CameraRig_AdaptiveQuality` displays the frames per second in the centre of the headset view.
  6656. The debug visualization of this script is displayed near the top edge of the headset view.
  6657. Pressing the trigger generates a new sphere and pressing the touchpad generates ten new spheres.
  6658. Eventually when lots of spheres are present the FPS will drop and demonstrate the script.
  6659. ---
  6660. ## Object Follow (VRTK_ObjectFollow)
  6661. ### Overview
  6662. Abstract class that allows to change one game object's properties to follow another game object.
  6663. ### Inspector Parameters
  6664. * **Game Object To Follow:** The game object to follow. The followed property values will be taken from this one.
  6665. * **Game Object To Change:** The game object to change the property values of. If left empty the game object this script is attached to will be changed.
  6666. * **Follows Position:** Whether to follow the position of the given game object.
  6667. * **Smooths Position:** Whether to smooth the position when following `gameObjectToFollow`.
  6668. * **Max Allowed Per Frame Distance Difference:** The maximum allowed distance between the unsmoothed source and the smoothed target per frame to use for smoothing.
  6669. * **Follows Rotation:** Whether to follow the rotation of the given game object.
  6670. * **Smooths Rotation:** Whether to smooth the rotation when following `gameObjectToFollow`.
  6671. * **Max Allowed Per Frame Angle Difference:** The maximum allowed angle between the unsmoothed source and the smoothed target per frame to use for smoothing.
  6672. * **Follows Scale:** Whether to follow the scale of the given game object.
  6673. * **Smooths Scale:** Whether to smooth the scale when following `gameObjectToFollow`.
  6674. * **Max Allowed Per Frame Size Difference:** The maximum allowed size between the unsmoothed source and the smoothed target per frame to use for smoothing.
  6675. ### Class Variables
  6676. * `public Vector3 targetPosition { get private set }` - The position that results by following `gameObjectToFollow`.
  6677. * `public Quaternion targetRotation { get private set }` - The rotation that results by following `gameObjectToFollow`.
  6678. * `public Vector3 targetScale { get private set }` - The scale that results by following `gameObjectToFollow`.
  6679. ### Class Methods
  6680. #### Follow/0
  6681. > `public virtual void Follow()`
  6682. * Parameters
  6683. * _none_
  6684. * Returns
  6685. * _none_
  6686. Follow `gameObjectToFollow` using the current settings.
  6687. ---
  6688. ## Rigidbody Follow (VRTK_RigidbodyFollow)
  6689. > extends [VRTK_ObjectFollow](#object-follow-vrtk_objectfollow)
  6690. ### Overview
  6691. Changes one GameObject's rigidbody to follow another GameObject's rigidbody.
  6692. ### Inspector Parameters
  6693. * **Movement Option:** Specifies how to position and rotate the rigidbody.
  6694. * **Track Max Distance:** The maximum distance the tracked `Game Object To Change` Rigidbody can be from the `Game Object To Follow` Rigidbody before the position is forcibly set to match the position.
  6695. ### Class Variables
  6696. * `public enum MovementOption` - Specifies how to position and rotate the rigidbody.
  6697. * `Set` - Use Rigidbody.position and Rigidbody.rotation.
  6698. * `Move` - Use Rigidbody.MovePosition and Rigidbody.MoveRotation.
  6699. * `Add` - Use Rigidbody.AddForce(Vector3) and Rigidbody.AddTorque(Vector3).
  6700. * `Track` - Use velocity and angular velocity with MoveTowards.
  6701. ### Class Methods
  6702. #### Follow/0
  6703. > `public override void Follow()`
  6704. * Parameters
  6705. * _none_
  6706. * Returns
  6707. * _none_
  6708. Follow `gameObjectToFollow` using the current settings.
  6709. ---
  6710. ## Transform Follow (VRTK_TransformFollow)
  6711. > extends [VRTK_ObjectFollow](#object-follow-vrtk_objectfollow)
  6712. ### Overview
  6713. Changes one GameObject's transform to follow another GameObject's transform.
  6714. ### Class Variables
  6715. * `public enum FollowMoment` - The moment at which to follow.
  6716. * `OnFixedUpdate` - Follow in the FixedUpdate method.
  6717. * `OnUpdate` - Follow in the Update method.
  6718. * `OnLateUpdate` - Follow in the LateUpdate method.
  6719. * `OnPreRender` - Follow in the OnPreRender method. (This script doesn't have to be attached to a camera).
  6720. * `OnPreCull` - Follow in the OnPreCull method. (This script doesn't have to be attached to a camera).
  6721. ### Class Methods
  6722. #### Follow/0
  6723. > `public override void Follow()`
  6724. * Parameters
  6725. * _none_
  6726. * Returns
  6727. * _none_
  6728. Follow `gameObjectToFollow` using the current settings.
  6729. ---
  6730. ## SDK Object Alias (VRTK_SDKObjectAlias)
  6731. ### Overview
  6732. The GameObject that the SDK Object Alias script is applied to will become a child of the selected SDK Object.
  6733. ### Inspector Parameters
  6734. * **Sdk Object:** The specific SDK Object to child this GameObject to.
  6735. ### Class Variables
  6736. * `public enum SDKObject` - Valid SDK Objects
  6737. * `Boundary` - The main camera rig/play area object that defines the player boundary.
  6738. * `Headset` - The main headset camera defines the player head.
  6739. ---
  6740. ## SDK Transform Modify (VRTK_SDKTransformModify)
  6741. > extends VRTK_SDKControllerReady
  6742. ### Overview
  6743. The SDK Transform Modify can be used to change a transform orientation at runtime based on the currently used SDK or SDK controller.
  6744. ### Inspector Parameters
  6745. * **Loaded SDK Setup:** An optional SDK Setup to use to determine when to modify the transform.
  6746. * **Controller Type:** An optional SDK controller type to use to determine when to modify the transform.
  6747. * **Position:** The new local position to change the transform to.
  6748. * **Rotation:** The new local rotation in eular angles to change the transform to.
  6749. * **Scale:** The new local scale to change the transform to.
  6750. * **Target:** The target Transform to modify on enable. If this is left blank then the Transform the script is attached to will be used.
  6751. * **Reset On Disable:** If this is checked then the target Transform will be reset to the original orientation when this script is disabled.
  6752. * **Sdk Overrides:** A collection of SDK Transform overrides to change the given target Transform for each specified SDK.
  6753. ### Class Methods
  6754. #### UpdateTransform/1
  6755. > `public virtual void UpdateTransform(VRTK_ControllerReference controllerReference = null)`
  6756. * Parameters
  6757. * `VRTK_ControllerReference controllerReference` - An optional reference to the controller to update the transform with.
  6758. * Returns
  6759. * _none_
  6760. The UpdateTransform method updates the Transform data on the current GameObject for the specified settings.
  6761. #### SetOrigins/0
  6762. > `public virtual void SetOrigins()`
  6763. * Parameters
  6764. * _none_
  6765. * Returns
  6766. * _none_
  6767. The SetOrigins method sets the original position, rotation, scale of the target Transform.
  6768. ---
  6769. ## SDK Object State (VRTK_SDKObjectState)
  6770. > extends VRTK_SDKControllerReady
  6771. ### Overview
  6772. The SDK Object State script can be used to set the enable/active state of a GameObject or Component based on SDK information.
  6773. The state can be determined by:
  6774. * The current loaded SDK setup.
  6775. * The current attached Headset type.
  6776. * The current attached Controller type.
  6777. ### Inspector Parameters
  6778. * **Target:** The GameObject or Component that is the target of the enable/disable action. If this is left blank then the GameObject that the script is attached to will be used as the `Target`.
  6779. * **Object State:** The state to set the `Target` to when this script is enabled. Checking this box will enable/activate the `Target`, unchecking will disable/deactivate the `Target`.
  6780. * **Loaded SDK Setup:** If the currently loaded SDK Setup matches the one provided here then the `Target` state will be set to the desired `Object State`.
  6781. * **Headset Type:** If the attached headset type matches the selected headset then the `Target` state will be set to the desired `Object State`.
  6782. * **Controller Type:** If the current controller type matches the selected controller type then the `Target` state will be set to the desired `Object State`.
  6783. ### Class Methods
  6784. #### SetStateByControllerReference/1
  6785. > `public virtual void SetStateByControllerReference(VRTK_ControllerReference controllerReference)`
  6786. * Parameters
  6787. * `VRTK_ControllerReference controllerReference` - A controller reference to check for the controller type of.
  6788. * Returns
  6789. * _none_
  6790. The SetStateByControllerReference method sets the object state based on the controller type of the given controller reference.
  6791. ---
  6792. ## SDK Input Override (VRTK_SDKInputOverride)
  6793. > extends VRTK_SDKControllerReady
  6794. ### Overview
  6795. Provides the ability to switch button mappings based on the current SDK or controller type
  6796. **Script Usage:**
  6797. * Place the `VRTK_SDKInputOverride` script on any active scene GameObject.
  6798. * Customise the input button for each script type for each SDK controller type.
  6799. ### Inspector Parameters
  6800. * **Loaded SDK Setup:** An optional SDK Setup to use to determine when to modify the transform.
  6801. * **Controller Type:** An optional SDK controller type to use to determine when to modify the transform.
  6802. * **Override Button:** The button to override to.
  6803. * **Override Axis:** The Vector2 axis to override to.
  6804. * **Interact Grab Script:** The Interact Grab script to override the controls on.
  6805. * **Interact Grab Overrides:** The list of overrides.
  6806. * **Interact Use Script:** The Interact Use script to override the controls on.
  6807. * **Interact Use Overrides:** The list of overrides.
  6808. * **Pointer Script:** The Pointer script to override the controls on.
  6809. * **Pointer Activation Overrides:** The list of overrides for the activation button.
  6810. * **Pointer Selection Overrides:** The list of overrides for the selection button.
  6811. * **Ui Pointer Script:** The UI Pointer script to override the controls on.
  6812. * **Ui Pointer Activation Overrides:** The list of overrides for the activation button.
  6813. * **Ui Pointer Selection Overrides:** The list of overrides for the selection button.
  6814. * **Pointer Direction Indicator Script:** The Pointer Direction Indicator script to override the controls on.
  6815. * **Direction Indicator Coordinate Overrides:** The list of overrides for the coordinate axis.
  6816. * **Touchpad Control Script:** The Touchpad Control script to override the controls on.
  6817. * **Touchpad Control Coordinate Overrides:** The list of overrides for the Touchpad Control coordinate axis.
  6818. * **Touchpad Control Activation Overrides:** The list of overrides for the activation button.
  6819. * **Touchpad Control Modifier Overrides:** The list of overrides for the modifier button.
  6820. * **Button Control Script:** The ButtonControl script to override the controls on.
  6821. * **Button Control Forward Overrides:** The list of overrides for the forward button.
  6822. * **Button Control Backward Overrides:** The list of overrides for the backward button.
  6823. * **Button Control Left Overrides:** The list of overrides for the left button.
  6824. * **Button Control Right Overrides:** The list of overrides for the right button.
  6825. * **Slingshot Jump Script:** The SlingshotJump script to override the controls on.
  6826. * **Slingshot Jump Activation Overrides:** The list of overrides for the activation button.
  6827. * **Slingshot Jump Cancel Overrides:** The list of overrides for the cancel button.
  6828. * **Move In Place Script:** The MoveInPlace script to override the controls on.
  6829. * **Move In Place Engage Overrides:** The list of overrides for the engage button.
  6830. * **Step Multiplier Script:** The Step Multiplier script to override the controls on.
  6831. * **Step Multiplier Activation Overrides:** The list of overrides for the activation button.
  6832. ### Class Methods
  6833. #### ForceManage/0
  6834. > `public virtual void ForceManage()`
  6835. * Parameters
  6836. * _none_
  6837. * Returns
  6838. * _none_
  6839. The ForceManage method forces the inputs to be updated even without an SDK change event occuring.
  6840. ---
  6841. ## Velocity Estimator (VRTK_VelocityEstimator)
  6842. ### Overview
  6843. The Velocity Estimator is used to calculate an estimated velocity on a moving object that is moving outside of Unity physics.
  6844. Objects that have rigidbodies and use Unity physics to move around will automatically provide accurate velocity and angular velocity information.
  6845. Any object that is moved around using absolute positions or moving the transform position will not be able to provide accurate velocity or angular velocity information.
  6846. When the Velocity Estimator script is applied to any GameObject it will provide a best case estimation of what the object's velocity and angular velocity is based on a given number of position and rotation samples.
  6847. The more samples used, the higher the precision but the script will be more demanding on processing time.
  6848. ### Inspector Parameters
  6849. * **Auto Start Sampling:** Begin the sampling routine when the script is enabled.
  6850. * **Velocity Average Frames:** The number of frames to average when calculating velocity.
  6851. * **Angular Velocity Average Frames:** The number of frames to average when calculating angular velocity.
  6852. ### Class Methods
  6853. #### StartEstimation/0
  6854. > `public virtual void StartEstimation()`
  6855. * Parameters
  6856. * _none_
  6857. * Returns
  6858. * _none_
  6859. The StartEstimation method begins logging samples of position and rotation for the GameObject.
  6860. #### EndEstimation/0
  6861. > `public virtual void EndEstimation()`
  6862. * Parameters
  6863. * _none_
  6864. * Returns
  6865. * _none_
  6866. The EndEstimation method stops logging samples of position and rotation for the GameObject.
  6867. #### GetVelocityEstimate/0
  6868. > `public virtual Vector3 GetVelocityEstimate()`
  6869. * Parameters
  6870. * _none_
  6871. * Returns
  6872. * `Vector3` - The velocity estimate vector of the GameObject
  6873. The GetVelocityEstimate method returns the current velocity estimate.
  6874. #### GetAngularVelocityEstimate/0
  6875. > `public virtual Vector3 GetAngularVelocityEstimate()`
  6876. * Parameters
  6877. * _none_
  6878. * Returns
  6879. * `Vector3` - The angular velocity estimate vector of the GameObject
  6880. The GetAngularVelocityEstimate method returns the current angular velocity estimate.
  6881. #### GetAccelerationEstimate/0
  6882. > `public virtual Vector3 GetAccelerationEstimate()`
  6883. * Parameters
  6884. * _none_
  6885. * Returns
  6886. * `Vector3` - The acceleration estimate vector of the GameObject
  6887. The GetAccelerationEstimate method returns the current acceleration estimate.
  6888. ---
  6889. # Base SDK (VRTK/Source/SDK/Base)
  6890. The base scripts used to determine the interface for interacting with a Unity VR SDK.
  6891. * [SDK Base](#sdk-base-sdk_base)
  6892. * [SDK Description](#sdk-description-sdk_descriptionattribute)
  6893. * [SDK Scripting Define Symbol Predicate](#sdk-scripting-define-symbol-predicate-sdk_scriptingdefinesymbolpredicateattribute)
  6894. * [Base System](#base-system-sdk_basesystem)
  6895. * [Base Headset](#base-headset-sdk_baseheadset)
  6896. * [Base Controller](#base-controller-sdk_basecontroller)
  6897. * [Base Boundaries](#base-boundaries-sdk_baseboundaries)
  6898. ---
  6899. ## SDK Base (SDK_Base)
  6900. > extends ScriptableObject
  6901. ### Overview
  6902. Abstract superclass that defines that a particular class is an SDK.
  6903. This is an abstract class to mark all different SDK endpoints with. This is used to allow for type safety when talking about 'an SDK' instead of one of the different endpoints (System, Boundaries, Headset, Controller).
  6904. ### Class Methods
  6905. #### OnBeforeSetupLoad/1
  6906. > `public virtual void OnBeforeSetupLoad(VRTK_SDKSetup setup)`
  6907. * Parameters
  6908. * `VRTK_SDKSetup setup` - The SDK Setup which is using this SDK.
  6909. * Returns
  6910. * _none_
  6911. This method is called just before loading the VRTK_SDKSetup that's using this SDK.
  6912. #### OnAfterSetupLoad/1
  6913. > `public virtual void OnAfterSetupLoad(VRTK_SDKSetup setup)`
  6914. * Parameters
  6915. * `VRTK_SDKSetup setup` - The SDK Setup which is using this SDK.
  6916. * Returns
  6917. * _none_
  6918. This method is called just after loading the VRTK_SDKSetup that's using this SDK.
  6919. #### OnBeforeSetupUnload/1
  6920. > `public virtual void OnBeforeSetupUnload(VRTK_SDKSetup setup)`
  6921. * Parameters
  6922. * `VRTK_SDKSetup setup` - The SDK Setup which is using this SDK.
  6923. * Returns
  6924. * _none_
  6925. This method is called just before unloading the VRTK_SDKSetup that's using this SDK.
  6926. #### OnAfterSetupUnload/1
  6927. > `public virtual void OnAfterSetupUnload(VRTK_SDKSetup setup)`
  6928. * Parameters
  6929. * `VRTK_SDKSetup setup` - The SDK Setup which is using this SDK.
  6930. * Returns
  6931. * _none_
  6932. This method is called just after unloading the VRTK_SDKSetup that's using this SDK.
  6933. ---
  6934. ## SDK Description (SDK_DescriptionAttribute)
  6935. > extends Attribute
  6936. ### Overview
  6937. Describes a class that represents an SDK. Only allowed on classes that inherit from SDK_Base.
  6938. ### Class Variables
  6939. * `public readonly string prettyName` - The pretty name of the SDK. Uniquely identifies the SDK.
  6940. * `public readonly string symbol` - The scripting define symbol needed for the SDK. Needs to be the same as `SDK_ScriptingDefineSymbolPredicateAttribute.symbol` to add and remove the scripting define symbol automatically using VRTK_SDKManager.
  6941. * `public readonly string vrDeviceName` - The name of the VR Device to load.
  6942. * `public readonly int index` - The index of this attribute, in case there are multiple on the same target.
  6943. * `public BuildTargetGroup buildTargetGroup` - The build target group this SDK is for.
  6944. * `public bool describesFallbackSDK` - Whether this description describes a fallback SDK.
  6945. ### Class Methods
  6946. #### SDK_DescriptionAttribute/5
  6947. > `public SDK_DescriptionAttribute(string prettyName, string symbol, string vrDeviceName, string buildTargetGroupName, int index = 0)`
  6948. * Parameters
  6949. * `string prettyName` - The pretty name of the SDK. Uniquely identifies the SDK. `null` and `string.Empty` aren't allowed.
  6950. * `string symbol` - The scripting define symbol needed for the SDK. Needs to be the same as `SDK_ScriptingDefineSymbolPredicateAttribute.symbol` to add and remove the scripting define symbol automatically using VRTK_SDKManager. `null` and `string.Empty` are allowed.
  6951. * `string vrDeviceName` - The name of the VR Device to load. Set to `null` or `string.Empty` if no VR Device is needed.
  6952. * `string buildTargetGroupName` - The name of a constant of `BuildTargetGroup`. `BuildTargetGroup.Unknown`, `null` and `string.Empty` are not allowed.
  6953. * `int index` - The index of this attribute, in case there are multiple on the same target.
  6954. * Returns
  6955. * _none_
  6956. Creates a new attribute.
  6957. #### SDK_DescriptionAttribute/2
  6958. > `public SDK_DescriptionAttribute(Type typeToCopyExistingDescriptionFrom, int index = 0)`
  6959. * Parameters
  6960. * `Type typeToCopyExistingDescriptionFrom` - The type to copy the existing SDK_DescriptionAttribute from. `null` is not allowed.
  6961. * `int index` - The index of the description to copy from the the existing SDK_DescriptionAttribute.
  6962. * Returns
  6963. * _none_
  6964. Creates a new attribute by copying from another attribute on a given type.
  6965. ---
  6966. ## SDK Scripting Define Symbol Predicate (SDK_ScriptingDefineSymbolPredicateAttribute)
  6967. > extends Attribute, ISerializationCallbackReceiver
  6968. ### Overview
  6969. Specifies a method to be used as a predicate to allow VRTK_SDKManager to automatically add and remove scripting define symbols. Only allowed on static methods that take no arguments and return a `bool`.
  6970. ### Class Variables
  6971. * `public const string RemovableSymbolPrefix` - The prefix of scripting define symbols that must be used to be able to automatically remove the symbols. Default: `"VRTK_DEFINE_"`
  6972. * `public string symbol` - The scripting define symbol to conditionally add or remove.
  6973. * `public BuildTargetGroup buildTargetGroup` - The build target group to use when conditionally adding or removing symbol.
  6974. ### Class Methods
  6975. #### SDK_ScriptingDefineSymbolPredicateAttribute/2
  6976. > `public SDK_ScriptingDefineSymbolPredicateAttribute(string symbol, string buildTargetGroupName)`
  6977. * Parameters
  6978. * `string symbol` - The scripting define symbol to conditionally add or remove. Needs to start with `RemovableSymbolPrefix` to be able to automatically remove the symbol. `null` and `string.Empty` are not allowed.
  6979. * `string buildTargetGroupName` - The name of a constant of `BuildTargetGroup`. `BuildTargetGroup.Unknown`, `null` and `string.Empty` are not allowed.
  6980. * Returns
  6981. * _none_
  6982. Creates a new attribute.
  6983. #### SDK_ScriptingDefineSymbolPredicateAttribute/1
  6984. > `public SDK_ScriptingDefineSymbolPredicateAttribute(SDK_ScriptingDefineSymbolPredicateAttribute attributeToCopy)`
  6985. * Parameters
  6986. * `SDK_ScriptingDefineSymbolPredicateAttribute attributeToCopy` - The attribute to copy.
  6987. * Returns
  6988. * _none_
  6989. Creates a new attribute by copying an existing one.
  6990. ---
  6991. ## Base System (SDK_BaseSystem)
  6992. > extends [SDK_Base](#sdk-base-sdk_base)
  6993. ### Overview
  6994. The Base System SDK script provides a bridge to core system SDK methods.
  6995. This is an abstract class to implement the interface required by all implemented SDKs.
  6996. ### Class Methods
  6997. #### IsDisplayOnDesktop/0
  6998. > `public abstract bool IsDisplayOnDesktop();`
  6999. * Parameters
  7000. * _none_
  7001. * Returns
  7002. * `bool` - Returns true if the display is extending the desktop
  7003. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  7004. #### ShouldAppRenderWithLowResources/0
  7005. > `public abstract bool ShouldAppRenderWithLowResources();`
  7006. * Parameters
  7007. * _none_
  7008. * Returns
  7009. * `bool` - Returns true if the Unity app should render with low resources.
  7010. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  7011. #### ForceInterleavedReprojectionOn/1
  7012. > `public abstract void ForceInterleavedReprojectionOn(bool force);`
  7013. * Parameters
  7014. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  7015. * Returns
  7016. * _none_
  7017. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  7018. ---
  7019. ## Base Headset (SDK_BaseHeadset)
  7020. > extends [SDK_Base](#sdk-base-sdk_base)
  7021. ### Overview
  7022. The Base Headset SDK script provides a bridge to SDK methods that deal with the VR Headset.
  7023. This is an abstract class to implement the interface required by all implemented SDKs.
  7024. ### Class Variables
  7025. * `public enum HeadsetType` - The connected headset type
  7026. * `Undefined` - The headset connected is unknown.
  7027. * `Simulator` - The headset associated with the simulator.
  7028. * `HTCVive` - The HTC Vive headset.
  7029. * `OculusRiftDK1` - The Oculus Rift DK1 headset.
  7030. * `OculusRiftDK2` - The Oculus Rift DK2 headset.
  7031. * `OculusRift` - The Oculus Rift headset.
  7032. * `OculusGearVR` - The Oculus GearVR headset.
  7033. * `GoogleDaydream` - The Google Daydream headset.
  7034. * `GoogleCardboard` - The Google Cardboard headset.
  7035. * `HyperealVR` - The HyperealVR headset.
  7036. * `WindowsMixedReality` - The Windows Mixed Reality headset.
  7037. ### Class Methods
  7038. #### ProcessUpdate/1
  7039. > `public abstract void ProcessUpdate(Dictionary<string, object> options);`
  7040. * Parameters
  7041. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  7042. * Returns
  7043. * _none_
  7044. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  7045. #### ProcessFixedUpdate/1
  7046. > `public abstract void ProcessFixedUpdate(Dictionary<string, object> options);`
  7047. * Parameters
  7048. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  7049. * Returns
  7050. * _none_
  7051. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  7052. #### GetHeadset/0
  7053. > `public abstract Transform GetHeadset();`
  7054. * Parameters
  7055. * _none_
  7056. * Returns
  7057. * `Transform` - A transform of the object representing the headset in the scene.
  7058. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  7059. #### GetHeadsetCamera/0
  7060. > `public abstract Transform GetHeadsetCamera();`
  7061. * Parameters
  7062. * _none_
  7063. * Returns
  7064. * `Transform` - A transform of the object holding the headset camera in the scene.
  7065. The GetHeadsetCamera method returns the Transform of the object that is used to hold the headset camera in the scene.
  7066. #### GetHeadsetType/0
  7067. > `public abstract string GetHeadsetType();`
  7068. * Parameters
  7069. * _none_
  7070. * Returns
  7071. * `string` - The string of the headset connected.
  7072. The GetHeadsetType method returns a string representing the type of headset connected.
  7073. #### GetHeadsetVelocity/0
  7074. > `public abstract Vector3 GetHeadsetVelocity();`
  7075. * Parameters
  7076. * _none_
  7077. * Returns
  7078. * `Vector3` - A Vector3 containing the current velocity of the headset.
  7079. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  7080. #### GetHeadsetAngularVelocity/0
  7081. > `public abstract Vector3 GetHeadsetAngularVelocity();`
  7082. * Parameters
  7083. * _none_
  7084. * Returns
  7085. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  7086. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  7087. #### HeadsetFade/3
  7088. > `public abstract void HeadsetFade(Color color, float duration, bool fadeOverlay = false);`
  7089. * Parameters
  7090. * `Color color` - The colour to fade to.
  7091. * `float duration` - The amount of time the fade should take to reach the given colour.
  7092. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  7093. * Returns
  7094. * _none_
  7095. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  7096. #### HasHeadsetFade/1
  7097. > `public abstract bool HasHeadsetFade(Transform obj);`
  7098. * Parameters
  7099. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  7100. * Returns
  7101. * `bool` - Returns true if the headset has fade functionality on it.
  7102. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  7103. #### AddHeadsetFade/1
  7104. > `public abstract void AddHeadsetFade(Transform camera);`
  7105. * Parameters
  7106. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  7107. * Returns
  7108. * _none_
  7109. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  7110. ---
  7111. ## Base Controller (SDK_BaseController)
  7112. > extends [SDK_Base](#sdk-base-sdk_base)
  7113. ### Overview
  7114. The Base Controller SDK script provides a bridge to SDK methods that deal with the input devices.
  7115. This is an abstract class to implement the interface required by all implemented SDKs.
  7116. ### Class Variables
  7117. * `public enum ButtonTypes` - Types of buttons on a controller
  7118. * `ButtonOne` - Button One on the controller.
  7119. * `ButtonTwo` - Button Two on the controller.
  7120. * `Grip` - Grip on the controller.
  7121. * `GripHairline` - Grip Hairline on the controller.
  7122. * `StartMenu` - Start Menu on the controller.
  7123. * `Trigger` - Trigger on the controller.
  7124. * `TriggerHairline` - Trigger Hairline on the controller.
  7125. * `Touchpad` - Touchpad on the controller.
  7126. * `TouchpadTwo` - Touchpad Two on the controller.
  7127. * `MiddleFinger` - Middle Finger on the controller.
  7128. * `RingFinger` - Ring Finger on the controller.
  7129. * `PinkyFinger` - Pinky Finger on the controller.
  7130. * `public enum ButtonPressTypes` - Concepts of controller button press
  7131. * `Press` - The button is currently being pressed.
  7132. * `PressDown` - The button has just been pressed down.
  7133. * `PressUp` - The button has just been released.
  7134. * `Touch` - The button is currently being touched.
  7135. * `TouchDown` - The button has just been touched.
  7136. * `TouchUp` - The button is no longer being touched.
  7137. * `public enum ControllerElements` - The elements of a generic controller
  7138. * `AttachPoint` - The default point on the controller to attach grabbed objects to.
  7139. * `Trigger` - The trigger button.
  7140. * `GripLeft` - The left part of the grip button collection.
  7141. * `GripRight` - The right part of the grip button collection.
  7142. * `Touchpad` - The touch pad/stick.
  7143. * `ButtonOne` - The first generic button.
  7144. * `ButtonTwo` - The second generic button.
  7145. * `SystemMenu` - The system menu button.
  7146. * `Body` - The encompassing mesh of the controller body.
  7147. * `StartMenu` - The start menu button.
  7148. * `TouchpadTwo` - The touch pad/stick two.
  7149. * `public enum ControllerHand` - Controller hand reference.
  7150. * `None` - No hand is assigned.
  7151. * `Left` - The left hand is assigned.
  7152. * `Right` - The right hand is assigned.
  7153. * `public enum ControllerType` - SDK Controller types.
  7154. * `Undefined` - No controller type.
  7155. * `Custom` - A custom controller type.
  7156. * `Simulator_Hand` - The Simulator default hand controller.
  7157. * `SteamVR_ViveWand` - The HTC Vive wand controller for SteamVR.
  7158. * `SteamVR_OculusTouch` - The Oculus Touch controller for SteamVR.
  7159. * `Oculus_OculusTouch` - The Oculus Touch controller for Oculus Utilities.
  7160. * `Daydream_Controller` - The Daydream controller for Google Daydream SDK.
  7161. * `Ximmerse_Flip` - The Flip controller for Ximmerse SDK.
  7162. * `SteamVR_ValveKnuckles` - The Valve Knuckles controller for SteamVR.
  7163. * `Oculus_OculusGamepad` - The Oculus Gamepad for Oculus Utilities.
  7164. * `Oculus_OculusRemote` - The Oculus Remote for Oculus Utilities.
  7165. * `Oculus_GearVRHMD` - The Oculus GearVR HMD controls for Oculus Utilities.
  7166. * `Oculus_GearVRController` - The Oculus GearVR controller for Oculus Utilities.
  7167. * `WindowsMR_MotionController` - The Windows Mixed Reality Motion Controller for Windows Mixed Reality.
  7168. * `SteamVR_WindowsMRController` - The Windows Mixed Reality Motion Controller for SteamVR.
  7169. ### Class Methods
  7170. #### ProcessUpdate/2
  7171. > `public abstract void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options);`
  7172. * Parameters
  7173. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  7174. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  7175. * Returns
  7176. * _none_
  7177. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  7178. #### ProcessFixedUpdate/2
  7179. > `public abstract void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options);`
  7180. * Parameters
  7181. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  7182. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  7183. * Returns
  7184. * _none_
  7185. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  7186. #### GetCurrentControllerType/1
  7187. > `public abstract ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null);`
  7188. * Parameters
  7189. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  7190. * Returns
  7191. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  7192. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  7193. #### GetControllerDefaultColliderPath/1
  7194. > `public abstract string GetControllerDefaultColliderPath(ControllerHand hand);`
  7195. * Parameters
  7196. * `ControllerHand hand` - The controller hand to check for
  7197. * Returns
  7198. * `string` - A path to the resource that contains the collider GameObject.
  7199. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  7200. #### GetControllerElementPath/3
  7201. > `public abstract string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false);`
  7202. * Parameters
  7203. * `ControllerElements element` - The controller element to look up.
  7204. * `ControllerHand hand` - The controller hand to look up.
  7205. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  7206. * Returns
  7207. * `string` - A string containing the path to the game object that the controller element resides in.
  7208. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  7209. #### GetControllerIndex/1
  7210. > `public abstract uint GetControllerIndex(GameObject controller);`
  7211. * Parameters
  7212. * `GameObject controller` - The GameObject containing the controller.
  7213. * Returns
  7214. * `uint` - The index of the given controller.
  7215. The GetControllerIndex method returns the index of the given controller.
  7216. #### GetControllerByIndex/2
  7217. > `public abstract GameObject GetControllerByIndex(uint index, bool actual = false);`
  7218. * Parameters
  7219. * `uint index` - The index of the controller to find.
  7220. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  7221. * Returns
  7222. * `GameObject` - The GameObject of the controller
  7223. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  7224. #### GetControllerOrigin/1
  7225. > `public abstract Transform GetControllerOrigin(VRTK_ControllerReference controllerReference);`
  7226. * Parameters
  7227. * `VRTK_ControllerReference controllerReference` - The reference to the controller to retrieve the origin from.
  7228. * Returns
  7229. * `Transform` - A Transform containing the origin of the controller.
  7230. The GetControllerOrigin method returns the origin of the given controller.
  7231. #### GetControllerLeftHand/1
  7232. > `public abstract GameObject GetControllerLeftHand(bool actual = false);`
  7233. * Parameters
  7234. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  7235. * Returns
  7236. * `GameObject` - The GameObject containing the left hand controller.
  7237. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  7238. #### GetControllerRightHand/1
  7239. > `public abstract GameObject GetControllerRightHand(bool actual = false);`
  7240. * Parameters
  7241. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  7242. * Returns
  7243. * `GameObject` - The GameObject containing the right hand controller.
  7244. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  7245. #### IsControllerLeftHand/1
  7246. > `public abstract bool IsControllerLeftHand(GameObject controller);`
  7247. * Parameters
  7248. * `GameObject controller` - The GameObject to check.
  7249. * Returns
  7250. * `bool` - Returns true if the given controller is the left hand controller.
  7251. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  7252. #### IsControllerRightHand/1
  7253. > `public abstract bool IsControllerRightHand(GameObject controller);`
  7254. * Parameters
  7255. * `GameObject controller` - The GameObject to check.
  7256. * Returns
  7257. * `bool` - Returns true if the given controller is the right hand controller.
  7258. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  7259. #### IsControllerLeftHand/2
  7260. > `public abstract bool IsControllerLeftHand(GameObject controller, bool actual);`
  7261. * Parameters
  7262. * `GameObject controller` - The GameObject to check.
  7263. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  7264. * Returns
  7265. * `bool` - Returns true if the given controller is the left hand controller.
  7266. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  7267. #### IsControllerRightHand/2
  7268. > `public abstract bool IsControllerRightHand(GameObject controller, bool actual);`
  7269. * Parameters
  7270. * `GameObject controller` - The GameObject to check.
  7271. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  7272. * Returns
  7273. * `bool` - Returns true if the given controller is the right hand controller.
  7274. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  7275. #### WaitForControllerModel/1
  7276. > `public abstract bool WaitForControllerModel(ControllerHand hand);`
  7277. * Parameters
  7278. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  7279. * Returns
  7280. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  7281. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  7282. #### GetControllerModel/1
  7283. > `public abstract GameObject GetControllerModel(GameObject controller);`
  7284. * Parameters
  7285. * `GameObject controller` - The GameObject to get the model alias for.
  7286. * Returns
  7287. * `GameObject` - The GameObject that has the model alias within it.
  7288. The GetControllerModel method returns the model alias for the given GameObject.
  7289. #### GetControllerModel/1
  7290. > `public abstract GameObject GetControllerModel(ControllerHand hand);`
  7291. * Parameters
  7292. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  7293. * Returns
  7294. * `GameObject` - The GameObject that has the model alias within it.
  7295. The GetControllerModel method returns the model alias for the given controller hand.
  7296. #### GetControllerModelHand/1
  7297. > `public virtual ControllerHand GetControllerModelHand(GameObject controllerModel)`
  7298. * Parameters
  7299. * `GameObject controllerModel` - The controller model GameObject to get the hand for.
  7300. * Returns
  7301. * `ControllerHand` - The hand enum for which the given controller model is for.
  7302. The GetControllerModelHand method returns the hand for the given controller model GameObject.
  7303. #### GetControllerRenderModel/1
  7304. > `public abstract GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference);`
  7305. * Parameters
  7306. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check.
  7307. * Returns
  7308. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  7309. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  7310. #### SetControllerRenderModelWheel/2
  7311. > `public abstract void SetControllerRenderModelWheel(GameObject renderModel, bool state);`
  7312. * Parameters
  7313. * `GameObject renderModel` - The GameObject containing the controller render model.
  7314. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  7315. * Returns
  7316. * _none_
  7317. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  7318. #### HapticPulse/2
  7319. > `public abstract void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5f);`
  7320. * Parameters
  7321. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  7322. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  7323. * Returns
  7324. * _none_
  7325. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  7326. #### HapticPulse/2
  7327. > `public abstract bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip);`
  7328. * Parameters
  7329. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  7330. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  7331. * Returns
  7332. * _none_
  7333. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  7334. #### GetHapticModifiers/0
  7335. > `public abstract SDK_ControllerHapticModifiers GetHapticModifiers();`
  7336. * Parameters
  7337. * _none_
  7338. * Returns
  7339. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  7340. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  7341. #### GetVelocity/1
  7342. > `public abstract Vector3 GetVelocity(VRTK_ControllerReference controllerReference);`
  7343. * Parameters
  7344. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  7345. * Returns
  7346. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  7347. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  7348. #### GetAngularVelocity/1
  7349. > `public abstract Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference);`
  7350. * Parameters
  7351. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  7352. * Returns
  7353. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  7354. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  7355. #### IsTouchpadStatic/4
  7356. > `public abstract bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity);`
  7357. * Parameters
  7358. * `Vector2 currentAxisValues` -
  7359. * `Vector2 previousAxisValues` -
  7360. * `int compareFidelity` -
  7361. * Returns
  7362. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  7363. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  7364. #### GetButtonAxis/2
  7365. > `public abstract Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference);`
  7366. * Parameters
  7367. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  7368. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  7369. * Returns
  7370. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  7371. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  7372. #### GetButtonSenseAxis/2
  7373. > `public abstract float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference);`
  7374. * Parameters
  7375. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  7376. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  7377. * Returns
  7378. * `float` - The current sense axis value.
  7379. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  7380. #### GetButtonHairlineDelta/2
  7381. > `public abstract float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference);`
  7382. * Parameters
  7383. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  7384. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  7385. * Returns
  7386. * `float` - The delta between the button presses.
  7387. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  7388. #### GetControllerButtonState/3
  7389. > `public abstract bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference);`
  7390. * Parameters
  7391. * `ButtonTypes buttonType` - The type of button to check for the state of.
  7392. * `ButtonPressTypes pressType` - The button state to check for.
  7393. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  7394. * Returns
  7395. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  7396. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  7397. ---
  7398. ## Base Boundaries (SDK_BaseBoundaries)
  7399. > extends [SDK_Base](#sdk-base-sdk_base)
  7400. ### Overview
  7401. The Base Boundaries SDK script provides a bridge to SDK methods that deal with the play area of SDKs that support room scale play spaces.
  7402. This is an abstract class to implement the interface required by all implemented SDKs.
  7403. ### Class Methods
  7404. #### InitBoundaries/0
  7405. > `public abstract void InitBoundaries();`
  7406. * Parameters
  7407. * _none_
  7408. * Returns
  7409. * _none_
  7410. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  7411. #### GetPlayArea/0
  7412. > `public abstract Transform GetPlayArea();`
  7413. * Parameters
  7414. * _none_
  7415. * Returns
  7416. * `Transform` - A transform of the object representing the play area in the scene.
  7417. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  7418. #### GetPlayAreaVertices/0
  7419. > `public abstract Vector3[] GetPlayAreaVertices();`
  7420. * Parameters
  7421. * _none_
  7422. * Returns
  7423. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  7424. The GetPlayAreaVertices method returns the points of the play area boundaries.
  7425. #### GetPlayAreaBorderThickness/0
  7426. > `public abstract float GetPlayAreaBorderThickness();`
  7427. * Parameters
  7428. * _none_
  7429. * Returns
  7430. * `float` - The thickness of the drawn border.
  7431. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  7432. #### IsPlayAreaSizeCalibrated/0
  7433. > `public abstract bool IsPlayAreaSizeCalibrated();`
  7434. * Parameters
  7435. * _none_
  7436. * Returns
  7437. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  7438. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  7439. #### GetDrawAtRuntime/0
  7440. > `public abstract bool GetDrawAtRuntime();`
  7441. * Parameters
  7442. * _none_
  7443. * Returns
  7444. * `bool` - Returns true if the drawn border is being displayed.
  7445. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  7446. #### SetDrawAtRuntime/1
  7447. > `public abstract void SetDrawAtRuntime(bool value);`
  7448. * Parameters
  7449. * `bool value` - The state of whether the drawn border should be displayed or not.
  7450. * Returns
  7451. * _none_
  7452. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  7453. ---
  7454. # Fallback SDK (VRTK/Source/SDK/Fallback)
  7455. The scripts used to provide a default/null fallback for any implemented SDK.
  7456. * [Fallback System](#fallback-system-sdk_fallbacksystem)
  7457. * [Fallback Headset](#fallback-headset-sdk_fallbackheadset)
  7458. * [Fallback Controller](#fallback-controller-sdk_fallbackcontroller)
  7459. * [Fallback Boundaries](#fallback-boundaries-sdk_fallbackboundaries)
  7460. ---
  7461. ## Fallback System (SDK_FallbackSystem)
  7462. > extends [SDK_BaseSystem](#base-system-sdk_basesystem)
  7463. ### Overview
  7464. The Fallback System SDK script provides a fallback collection of methods that return null or default system values.
  7465. This is the fallback class that will just return default values.
  7466. ### Class Methods
  7467. #### IsDisplayOnDesktop/0
  7468. > `public override bool IsDisplayOnDesktop()`
  7469. * Parameters
  7470. * _none_
  7471. * Returns
  7472. * `bool` - Returns true if the display is extending the desktop
  7473. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  7474. #### ShouldAppRenderWithLowResources/0
  7475. > `public override bool ShouldAppRenderWithLowResources()`
  7476. * Parameters
  7477. * _none_
  7478. * Returns
  7479. * `bool` - Returns true if the Unity app should render with low resources.
  7480. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  7481. #### ForceInterleavedReprojectionOn/1
  7482. > `public override void ForceInterleavedReprojectionOn(bool force)`
  7483. * Parameters
  7484. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  7485. * Returns
  7486. * _none_
  7487. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  7488. ---
  7489. ## Fallback Headset (SDK_FallbackHeadset)
  7490. > extends [SDK_BaseHeadset](#base-headset-sdk_baseheadset)
  7491. ### Overview
  7492. The Fallback Headset SDK script provides a fallback collection of methods that return null or default headset values.
  7493. This is the fallback class that will just return default values.
  7494. ### Class Methods
  7495. #### ProcessUpdate/1
  7496. > `public override void ProcessUpdate(Dictionary<string, object> options)`
  7497. * Parameters
  7498. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  7499. * Returns
  7500. * _none_
  7501. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  7502. #### ProcessFixedUpdate/1
  7503. > `public override void ProcessFixedUpdate(Dictionary<string, object> options)`
  7504. * Parameters
  7505. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  7506. * Returns
  7507. * _none_
  7508. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  7509. #### GetHeadset/0
  7510. > `public override Transform GetHeadset()`
  7511. * Parameters
  7512. * _none_
  7513. * Returns
  7514. * `Transform` - A transform of the object representing the headset in the scene.
  7515. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  7516. #### GetHeadsetCamera/0
  7517. > `public override Transform GetHeadsetCamera()`
  7518. * Parameters
  7519. * _none_
  7520. * Returns
  7521. * `Transform` - A transform of the object holding the headset camera in the scene.
  7522. The GetHeadsetCamera method returns the Transform of the object that is used to hold the headset camera in the scene.
  7523. #### GetHeadsetType/0
  7524. > `public override string GetHeadsetType()`
  7525. * Parameters
  7526. * _none_
  7527. * Returns
  7528. * `string` - The string of the headset connected.
  7529. The GetHeadsetType method returns a string representing the type of headset connected.
  7530. #### GetHeadsetVelocity/0
  7531. > `public override Vector3 GetHeadsetVelocity()`
  7532. * Parameters
  7533. * _none_
  7534. * Returns
  7535. * `Vector3` - A Vector3 containing the current velocity of the headset.
  7536. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  7537. #### GetHeadsetAngularVelocity/0
  7538. > `public override Vector3 GetHeadsetAngularVelocity()`
  7539. * Parameters
  7540. * _none_
  7541. * Returns
  7542. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  7543. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  7544. #### HeadsetFade/3
  7545. > `public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)`
  7546. * Parameters
  7547. * `Color color` - The colour to fade to.
  7548. * `float duration` - The amount of time the fade should take to reach the given colour.
  7549. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  7550. * Returns
  7551. * _none_
  7552. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  7553. #### HasHeadsetFade/1
  7554. > `public override bool HasHeadsetFade(Transform obj)`
  7555. * Parameters
  7556. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  7557. * Returns
  7558. * `bool` - Returns true if the headset has fade functionality on it.
  7559. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  7560. #### AddHeadsetFade/1
  7561. > `public override void AddHeadsetFade(Transform camera)`
  7562. * Parameters
  7563. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  7564. * Returns
  7565. * _none_
  7566. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  7567. ---
  7568. ## Fallback Controller (SDK_FallbackController)
  7569. > extends [SDK_BaseController](#base-controller-sdk_basecontroller)
  7570. ### Overview
  7571. The Fallback Controller SDK script provides a fallback collection of methods that return null or default headset values.
  7572. This is the fallback class that will just return default values.
  7573. ### Class Methods
  7574. #### ProcessUpdate/2
  7575. > `public override void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  7576. * Parameters
  7577. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  7578. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  7579. * Returns
  7580. * _none_
  7581. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  7582. #### ProcessFixedUpdate/2
  7583. > `public override void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  7584. * Parameters
  7585. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  7586. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  7587. * Returns
  7588. * _none_
  7589. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  7590. #### GetCurrentControllerType/1
  7591. > `public override ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  7592. * Parameters
  7593. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  7594. * Returns
  7595. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  7596. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  7597. #### GetControllerDefaultColliderPath/1
  7598. > `public override string GetControllerDefaultColliderPath(ControllerHand hand)`
  7599. * Parameters
  7600. * `ControllerHand hand` - The controller hand to check for
  7601. * Returns
  7602. * `string` - A path to the resource that contains the collider GameObject.
  7603. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  7604. #### GetControllerElementPath/3
  7605. > `public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)`
  7606. * Parameters
  7607. * `ControllerElements element` - The controller element to look up.
  7608. * `ControllerHand hand` - The controller hand to look up.
  7609. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  7610. * Returns
  7611. * `string` - A string containing the path to the game object that the controller element resides in.
  7612. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  7613. #### GetControllerIndex/1
  7614. > `public override uint GetControllerIndex(GameObject controller)`
  7615. * Parameters
  7616. * `GameObject controller` - The GameObject containing the controller.
  7617. * Returns
  7618. * `uint` - The index of the given controller.
  7619. The GetControllerIndex method returns the index of the given controller.
  7620. #### GetControllerByIndex/2
  7621. > `public override GameObject GetControllerByIndex(uint index, bool actual = false)`
  7622. * Parameters
  7623. * `uint index` - The index of the controller to find.
  7624. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  7625. * Returns
  7626. * `GameObject` - The GameObject of the controller
  7627. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  7628. #### GetControllerOrigin/1
  7629. > `public override Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  7630. * Parameters
  7631. * `VRTK_ControllerReference controllerReference` - The reference to the controller to retrieve the origin from.
  7632. * Returns
  7633. * `Transform` - A Transform containing the origin of the controller.
  7634. The GetControllerOrigin method returns the origin of the given controller.
  7635. #### GetControllerLeftHand/1
  7636. > `public override GameObject GetControllerLeftHand(bool actual = false)`
  7637. * Parameters
  7638. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  7639. * Returns
  7640. * `GameObject` - The GameObject containing the left hand controller.
  7641. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  7642. #### GetControllerRightHand/1
  7643. > `public override GameObject GetControllerRightHand(bool actual = false)`
  7644. * Parameters
  7645. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  7646. * Returns
  7647. * `GameObject` - The GameObject containing the right hand controller.
  7648. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  7649. #### IsControllerLeftHand/1
  7650. > `public override bool IsControllerLeftHand(GameObject controller)`
  7651. * Parameters
  7652. * `GameObject controller` - The GameObject to check.
  7653. * Returns
  7654. * `bool` - Returns true if the given controller is the left hand controller.
  7655. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  7656. #### IsControllerRightHand/1
  7657. > `public override bool IsControllerRightHand(GameObject controller)`
  7658. * Parameters
  7659. * `GameObject controller` - The GameObject to check.
  7660. * Returns
  7661. * `bool` - Returns true if the given controller is the right hand controller.
  7662. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  7663. #### IsControllerLeftHand/2
  7664. > `public override bool IsControllerLeftHand(GameObject controller, bool actual)`
  7665. * Parameters
  7666. * `GameObject controller` - The GameObject to check.
  7667. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  7668. * Returns
  7669. * `bool` - Returns true if the given controller is the left hand controller.
  7670. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  7671. #### IsControllerRightHand/2
  7672. > `public override bool IsControllerRightHand(GameObject controller, bool actual)`
  7673. * Parameters
  7674. * `GameObject controller` - The GameObject to check.
  7675. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  7676. * Returns
  7677. * `bool` - Returns true if the given controller is the right hand controller.
  7678. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  7679. #### WaitForControllerModel/1
  7680. > `public override bool WaitForControllerModel(ControllerHand hand)`
  7681. * Parameters
  7682. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  7683. * Returns
  7684. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  7685. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  7686. #### GetControllerModel/1
  7687. > `public override GameObject GetControllerModel(GameObject controller)`
  7688. * Parameters
  7689. * `GameObject controller` - The GameObject to get the model alias for.
  7690. * Returns
  7691. * `GameObject` - The GameObject that has the model alias within it.
  7692. The GetControllerModel method returns the model alias for the given GameObject.
  7693. #### GetControllerModel/1
  7694. > `public override GameObject GetControllerModel(ControllerHand hand)`
  7695. * Parameters
  7696. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  7697. * Returns
  7698. * `GameObject` - The GameObject that has the model alias within it.
  7699. The GetControllerModel method returns the model alias for the given controller hand.
  7700. #### GetControllerRenderModel/1
  7701. > `public override GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference)`
  7702. * Parameters
  7703. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check.
  7704. * Returns
  7705. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  7706. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  7707. #### SetControllerRenderModelWheel/2
  7708. > `public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)`
  7709. * Parameters
  7710. * `GameObject renderModel` - The GameObject containing the controller render model.
  7711. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  7712. * Returns
  7713. * _none_
  7714. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  7715. #### HapticPulse/2
  7716. > `public override void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5f)`
  7717. * Parameters
  7718. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  7719. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  7720. * Returns
  7721. * _none_
  7722. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  7723. #### HapticPulse/2
  7724. > `public override bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip)`
  7725. * Parameters
  7726. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  7727. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  7728. * Returns
  7729. * _none_
  7730. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  7731. #### GetHapticModifiers/0
  7732. > `public override SDK_ControllerHapticModifiers GetHapticModifiers()`
  7733. * Parameters
  7734. * _none_
  7735. * Returns
  7736. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  7737. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  7738. #### GetVelocity/1
  7739. > `public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference)`
  7740. * Parameters
  7741. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  7742. * Returns
  7743. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  7744. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  7745. #### GetAngularVelocity/1
  7746. > `public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)`
  7747. * Parameters
  7748. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  7749. * Returns
  7750. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  7751. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  7752. #### IsTouchpadStatic/4
  7753. > `public override bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity)`
  7754. * Parameters
  7755. * `Vector2 currentAxisValues` -
  7756. * `Vector2 previousAxisValues` -
  7757. * `int compareFidelity` -
  7758. * Returns
  7759. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  7760. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  7761. #### GetButtonAxis/2
  7762. > `public override Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  7763. * Parameters
  7764. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  7765. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  7766. * Returns
  7767. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  7768. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  7769. #### GetButtonSenseAxis/2
  7770. > `public override float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  7771. * Parameters
  7772. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  7773. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  7774. * Returns
  7775. * `float` - The current sense axis value.
  7776. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  7777. #### GetButtonHairlineDelta/2
  7778. > `public override float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  7779. * Parameters
  7780. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  7781. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  7782. * Returns
  7783. * `float` - The delta between the button presses.
  7784. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  7785. #### GetControllerButtonState/3
  7786. > `public override bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference)`
  7787. * Parameters
  7788. * `ButtonTypes buttonType` - The type of button to check for the state of.
  7789. * `ButtonPressTypes pressType` - The button state to check for.
  7790. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  7791. * Returns
  7792. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  7793. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  7794. ---
  7795. ## Fallback Boundaries (SDK_FallbackBoundaries)
  7796. > extends [SDK_BaseBoundaries](#base-boundaries-sdk_baseboundaries)
  7797. ### Overview
  7798. The Fallback Boundaries SDK script provides a fallback collection of methods that return null or default headset values.
  7799. This is the fallback class that will just return default values.
  7800. ### Class Methods
  7801. #### InitBoundaries/0
  7802. > `public override void InitBoundaries()`
  7803. * Parameters
  7804. * _none_
  7805. * Returns
  7806. * _none_
  7807. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  7808. #### GetPlayArea/0
  7809. > `public override Transform GetPlayArea()`
  7810. * Parameters
  7811. * _none_
  7812. * Returns
  7813. * `Transform` - A transform of the object representing the play area in the scene.
  7814. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  7815. #### GetPlayAreaVertices/0
  7816. > `public override Vector3[] GetPlayAreaVertices()`
  7817. * Parameters
  7818. * _none_
  7819. * Returns
  7820. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  7821. The GetPlayAreaVertices method returns the points of the play area boundaries.
  7822. #### GetPlayAreaBorderThickness/0
  7823. > `public override float GetPlayAreaBorderThickness()`
  7824. * Parameters
  7825. * _none_
  7826. * Returns
  7827. * `float` - The thickness of the drawn border.
  7828. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  7829. #### IsPlayAreaSizeCalibrated/0
  7830. > `public override bool IsPlayAreaSizeCalibrated()`
  7831. * Parameters
  7832. * _none_
  7833. * Returns
  7834. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  7835. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  7836. #### GetDrawAtRuntime/0
  7837. > `public override bool GetDrawAtRuntime()`
  7838. * Parameters
  7839. * _none_
  7840. * Returns
  7841. * `bool` - Returns true if the drawn border is being displayed.
  7842. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  7843. #### SetDrawAtRuntime/1
  7844. > `public override void SetDrawAtRuntime(bool value)`
  7845. * Parameters
  7846. * `bool value` - The state of whether the drawn border should be displayed or not.
  7847. * Returns
  7848. * _none_
  7849. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  7850. ---
  7851. # Unity SDK (VRTK/Source/SDK/Unity)
  7852. The scripts used to utilise the built in UnityEngine.VR SDK.
  7853. * [Unity System](#unity-system-sdk_unitysystem)
  7854. * [Unity Headset](#unity-headset-sdk_unityheadset)
  7855. * [Unity Controller](#unity-controller-sdk_unitycontroller)
  7856. * [Unity Boundaries](#unity-boundaries-sdk_unityboundaries)
  7857. * [Unity SDK Controller Tracker](#unity-sdk-controller-tracker-sdk_unitycontrollertracker)
  7858. * [Unity SDK Headset Tracker](#unity-sdk-headset-tracker-sdk_unityheadsettracker)
  7859. ---
  7860. ## Unity System (SDK_UnitySystem)
  7861. > extends [SDK_BaseSystem](#base-system-sdk_basesystem)
  7862. ### Overview
  7863. The Unity System SDK script provides a bridge to the Unity SDK.
  7864. ### Class Methods
  7865. #### IsDisplayOnDesktop/0
  7866. > `public override bool IsDisplayOnDesktop()`
  7867. * Parameters
  7868. * _none_
  7869. * Returns
  7870. * `bool` - Returns true if the display is extending the desktop
  7871. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  7872. #### ShouldAppRenderWithLowResources/0
  7873. > `public override bool ShouldAppRenderWithLowResources()`
  7874. * Parameters
  7875. * _none_
  7876. * Returns
  7877. * `bool` - Returns true if the Unity app should render with low resources.
  7878. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  7879. #### ForceInterleavedReprojectionOn/1
  7880. > `public override void ForceInterleavedReprojectionOn(bool force)`
  7881. * Parameters
  7882. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  7883. * Returns
  7884. * _none_
  7885. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  7886. ---
  7887. ## Unity Headset (SDK_UnityHeadset)
  7888. > extends [SDK_BaseHeadset](#base-headset-sdk_baseheadset)
  7889. ### Overview
  7890. The Unity Headset SDK script provides a bridge to the base Unity headset support.
  7891. ### Class Methods
  7892. #### ProcessUpdate/1
  7893. > `public override void ProcessUpdate(Dictionary<string, object> options)`
  7894. * Parameters
  7895. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  7896. * Returns
  7897. * _none_
  7898. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  7899. #### ProcessFixedUpdate/1
  7900. > `public override void ProcessFixedUpdate(Dictionary<string, object> options)`
  7901. * Parameters
  7902. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  7903. * Returns
  7904. * _none_
  7905. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  7906. #### GetHeadset/0
  7907. > `public override Transform GetHeadset()`
  7908. * Parameters
  7909. * _none_
  7910. * Returns
  7911. * `Transform` - A transform of the object representing the headset in the scene.
  7912. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  7913. #### GetHeadsetCamera/0
  7914. > `public override Transform GetHeadsetCamera()`
  7915. * Parameters
  7916. * _none_
  7917. * Returns
  7918. * `Transform` - A transform of the object holding the headset camera in the scene.
  7919. The GetHeadsetCamera method returns the Transform of the object that is used to hold the headset camera in the scene.
  7920. #### GetHeadsetType/0
  7921. > `public override string GetHeadsetType()`
  7922. * Parameters
  7923. * _none_
  7924. * Returns
  7925. * `string` - The string of the headset connected.
  7926. The GetHeadsetType method returns a string representing the type of headset connected.
  7927. #### GetHeadsetVelocity/0
  7928. > `public override Vector3 GetHeadsetVelocity()`
  7929. * Parameters
  7930. * _none_
  7931. * Returns
  7932. * `Vector3` - A Vector3 containing the current velocity of the headset.
  7933. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  7934. #### GetHeadsetAngularVelocity/0
  7935. > `public override Vector3 GetHeadsetAngularVelocity()`
  7936. * Parameters
  7937. * _none_
  7938. * Returns
  7939. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  7940. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  7941. #### HeadsetFade/3
  7942. > `public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)`
  7943. * Parameters
  7944. * `Color color` - The colour to fade to.
  7945. * `float duration` - The amount of time the fade should take to reach the given colour.
  7946. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  7947. * Returns
  7948. * _none_
  7949. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  7950. #### HasHeadsetFade/1
  7951. > `public override bool HasHeadsetFade(Transform obj)`
  7952. * Parameters
  7953. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  7954. * Returns
  7955. * `bool` - Returns true if the headset has fade functionality on it.
  7956. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  7957. #### AddHeadsetFade/1
  7958. > `public override void AddHeadsetFade(Transform camera)`
  7959. * Parameters
  7960. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  7961. * Returns
  7962. * _none_
  7963. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  7964. ---
  7965. ## Unity Controller (SDK_UnityController)
  7966. > extends [SDK_BaseController](#base-controller-sdk_basecontroller)
  7967. ### Overview
  7968. The Unity Controller SDK script provides a bridge to the base Unity input device support.
  7969. ### Class Methods
  7970. #### ProcessUpdate/2
  7971. > `public override void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  7972. * Parameters
  7973. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  7974. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  7975. * Returns
  7976. * _none_
  7977. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  7978. #### ProcessFixedUpdate/2
  7979. > `public override void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  7980. * Parameters
  7981. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  7982. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  7983. * Returns
  7984. * _none_
  7985. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  7986. #### GetCurrentControllerType/1
  7987. > `public override ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  7988. * Parameters
  7989. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  7990. * Returns
  7991. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  7992. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  7993. #### GetControllerDefaultColliderPath/1
  7994. > `public override string GetControllerDefaultColliderPath(ControllerHand hand)`
  7995. * Parameters
  7996. * `ControllerHand hand` - The controller hand to check for
  7997. * Returns
  7998. * `string` - A path to the resource that contains the collider GameObject.
  7999. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  8000. #### GetControllerElementPath/3
  8001. > `public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)`
  8002. * Parameters
  8003. * `ControllerElements element` - The controller element to look up.
  8004. * `ControllerHand hand` - The controller hand to look up.
  8005. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  8006. * Returns
  8007. * `string` - A string containing the path to the game object that the controller element resides in.
  8008. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  8009. #### GetControllerIndex/1
  8010. > `public override uint GetControllerIndex(GameObject controller)`
  8011. * Parameters
  8012. * `GameObject controller` - The GameObject containing the controller.
  8013. * Returns
  8014. * `uint` - The index of the given controller.
  8015. The GetControllerIndex method returns the index of the given controller.
  8016. #### GetControllerByIndex/2
  8017. > `public override GameObject GetControllerByIndex(uint index, bool actual = false)`
  8018. * Parameters
  8019. * `uint index` - The index of the controller to find.
  8020. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  8021. * Returns
  8022. * `GameObject` - The GameObject of the controller
  8023. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  8024. #### GetControllerOrigin/1
  8025. > `public override Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  8026. * Parameters
  8027. * `VRTK_ControllerReference controllerReference` - The reference to the controller to retrieve the origin from.
  8028. * Returns
  8029. * `Transform` - A Transform containing the origin of the controller.
  8030. The GetControllerOrigin method returns the origin of the given controller.
  8031. #### GetControllerLeftHand/1
  8032. > `public override GameObject GetControllerLeftHand(bool actual = false)`
  8033. * Parameters
  8034. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  8035. * Returns
  8036. * `GameObject` - The GameObject containing the left hand controller.
  8037. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  8038. #### GetControllerRightHand/1
  8039. > `public override GameObject GetControllerRightHand(bool actual = false)`
  8040. * Parameters
  8041. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  8042. * Returns
  8043. * `GameObject` - The GameObject containing the right hand controller.
  8044. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  8045. #### IsControllerLeftHand/1
  8046. > `public override bool IsControllerLeftHand(GameObject controller)`
  8047. * Parameters
  8048. * `GameObject controller` - The GameObject to check.
  8049. * Returns
  8050. * `bool` - Returns true if the given controller is the left hand controller.
  8051. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  8052. #### IsControllerRightHand/1
  8053. > `public override bool IsControllerRightHand(GameObject controller)`
  8054. * Parameters
  8055. * `GameObject controller` - The GameObject to check.
  8056. * Returns
  8057. * `bool` - Returns true if the given controller is the right hand controller.
  8058. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  8059. #### IsControllerLeftHand/2
  8060. > `public override bool IsControllerLeftHand(GameObject controller, bool actual)`
  8061. * Parameters
  8062. * `GameObject controller` - The GameObject to check.
  8063. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  8064. * Returns
  8065. * `bool` - Returns true if the given controller is the left hand controller.
  8066. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  8067. #### IsControllerRightHand/2
  8068. > `public override bool IsControllerRightHand(GameObject controller, bool actual)`
  8069. * Parameters
  8070. * `GameObject controller` - The GameObject to check.
  8071. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  8072. * Returns
  8073. * `bool` - Returns true if the given controller is the right hand controller.
  8074. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  8075. #### WaitForControllerModel/1
  8076. > `public override bool WaitForControllerModel(ControllerHand hand)`
  8077. * Parameters
  8078. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  8079. * Returns
  8080. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  8081. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  8082. #### GetControllerModel/1
  8083. > `public override GameObject GetControllerModel(GameObject controller)`
  8084. * Parameters
  8085. * `GameObject controller` - The GameObject to get the model alias for.
  8086. * Returns
  8087. * `GameObject` - The GameObject that has the model alias within it.
  8088. The GetControllerModel method returns the model alias for the given GameObject.
  8089. #### GetControllerModel/1
  8090. > `public override GameObject GetControllerModel(ControllerHand hand)`
  8091. * Parameters
  8092. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  8093. * Returns
  8094. * `GameObject` - The GameObject that has the model alias within it.
  8095. The GetControllerModel method returns the model alias for the given controller hand.
  8096. #### GetControllerRenderModel/1
  8097. > `public override GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference)`
  8098. * Parameters
  8099. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check.
  8100. * Returns
  8101. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  8102. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  8103. #### SetControllerRenderModelWheel/2
  8104. > `public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)`
  8105. * Parameters
  8106. * `GameObject renderModel` - The GameObject containing the controller render model.
  8107. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  8108. * Returns
  8109. * _none_
  8110. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  8111. #### HapticPulse/2
  8112. > `public override void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5f)`
  8113. * Parameters
  8114. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  8115. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  8116. * Returns
  8117. * _none_
  8118. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  8119. #### HapticPulse/2
  8120. > `public override bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip)`
  8121. * Parameters
  8122. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  8123. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  8124. * Returns
  8125. * _none_
  8126. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  8127. #### GetHapticModifiers/0
  8128. > `public override SDK_ControllerHapticModifiers GetHapticModifiers()`
  8129. * Parameters
  8130. * _none_
  8131. * Returns
  8132. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  8133. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  8134. #### GetVelocity/1
  8135. > `public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference)`
  8136. * Parameters
  8137. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  8138. * Returns
  8139. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  8140. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  8141. #### GetAngularVelocity/1
  8142. > `public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)`
  8143. * Parameters
  8144. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  8145. * Returns
  8146. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  8147. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  8148. #### IsTouchpadStatic/4
  8149. > `public override bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity)`
  8150. * Parameters
  8151. * `Vector2 currentAxisValues` -
  8152. * `Vector2 previousAxisValues` -
  8153. * `int compareFidelity` -
  8154. * Returns
  8155. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  8156. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  8157. #### GetButtonAxis/2
  8158. > `public override Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  8159. * Parameters
  8160. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  8161. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  8162. * Returns
  8163. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  8164. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  8165. #### GetButtonSenseAxis/2
  8166. > `public override float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  8167. * Parameters
  8168. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  8169. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  8170. * Returns
  8171. * `float` - The current sense axis value.
  8172. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  8173. #### GetButtonHairlineDelta/2
  8174. > `public override float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  8175. * Parameters
  8176. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  8177. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  8178. * Returns
  8179. * `float` - The delta between the button presses.
  8180. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  8181. #### GetControllerButtonState/3
  8182. > `public override bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference)`
  8183. * Parameters
  8184. * `ButtonTypes buttonType` - The type of button to check for the state of.
  8185. * `ButtonPressTypes pressType` - The button state to check for.
  8186. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  8187. * Returns
  8188. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  8189. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  8190. ---
  8191. ## Unity Boundaries (SDK_UnityBoundaries)
  8192. > extends [SDK_BaseBoundaries](#base-boundaries-sdk_baseboundaries)
  8193. ### Overview
  8194. The Unity Boundaries SDK script provides a bridge to a default Unity play area.
  8195. ### Class Methods
  8196. #### InitBoundaries/0
  8197. > `public override void InitBoundaries()`
  8198. * Parameters
  8199. * _none_
  8200. * Returns
  8201. * _none_
  8202. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  8203. #### GetPlayArea/0
  8204. > `public override Transform GetPlayArea()`
  8205. * Parameters
  8206. * _none_
  8207. * Returns
  8208. * `Transform` - A transform of the object representing the play area in the scene.
  8209. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  8210. #### GetPlayAreaVertices/0
  8211. > `public override Vector3[] GetPlayAreaVertices()`
  8212. * Parameters
  8213. * _none_
  8214. * Returns
  8215. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  8216. The GetPlayAreaVertices method returns the points of the play area boundaries.
  8217. #### GetPlayAreaBorderThickness/0
  8218. > `public override float GetPlayAreaBorderThickness()`
  8219. * Parameters
  8220. * _none_
  8221. * Returns
  8222. * `float` - The thickness of the drawn border.
  8223. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  8224. #### IsPlayAreaSizeCalibrated/0
  8225. > `public override bool IsPlayAreaSizeCalibrated()`
  8226. * Parameters
  8227. * _none_
  8228. * Returns
  8229. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  8230. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  8231. #### GetDrawAtRuntime/0
  8232. > `public override bool GetDrawAtRuntime()`
  8233. * Parameters
  8234. * _none_
  8235. * Returns
  8236. * `bool` - Returns true if the drawn border is being displayed.
  8237. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  8238. #### SetDrawAtRuntime/1
  8239. > `public override void SetDrawAtRuntime(bool value)`
  8240. * Parameters
  8241. * `bool value` - The state of whether the drawn border should be displayed or not.
  8242. * Returns
  8243. * _none_
  8244. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  8245. ---
  8246. ## Unity SDK Controller Tracker (SDK_UnityControllerTracker)
  8247. ### Overview
  8248. The Controller Tracker enables the GameObject to track it's position/rotation to the available connected VR Controller via the `UnityEngine.VR` library.
  8249. The Unity Controller Tracker is attached to the `[UnityBase_CameraRig]` prefab on the child `LeftHandAnchor` and `RightHandAnchor` to enable controller tracking.
  8250. ### Inspector Parameters
  8251. * **Node Type:** The Unity VRNode to track.
  8252. * **Index:** The unique index to assign to the controller.
  8253. * **Trigger Axis Name:** The Unity Input name for the trigger axis.
  8254. * **Grip Axis Name:** The Unity Input name for the grip axis.
  8255. * **Touchpad Horizontal Axis Name:** The Unity Input name for the touchpad horizontal axis.
  8256. * **Touchpad Vertical Axis Name:** The Unity Input name for the touchpad vertical axis.
  8257. ---
  8258. ## Unity SDK Headset Tracker (SDK_UnityHeadsetTracker)
  8259. ### Overview
  8260. The Headset Tracker enables the GameObject to track it's position/rotation to the available connected VR HMD via the `UnityEngine.VR` library.
  8261. The Unity Headset Tracker is attached to the `[UnityBase_CameraRig]` prefab on the child `Head` HMD tracking.
  8262. ---
  8263. # Simulator SDK (VRTK/Source/SDK/Simulator)
  8264. The scripts used to utilise the VR Simulator to build without VR Hardware.
  8265. * [Simulator System](#simulator-system-sdk_simsystem)
  8266. * [Simulator Headset](#simulator-headset-sdk_simheadset)
  8267. * [Simulator Controller](#simulator-controller-sdk_simcontroller)
  8268. * [Simulator Boundaries](#simulator-boundaries-sdk_simboundaries)
  8269. ---
  8270. ## Simulator System (SDK_SimSystem)
  8271. > extends [SDK_BaseSystem](#base-system-sdk_basesystem)
  8272. ### Overview
  8273. The Sim System SDK script provides dummy functions for system functions.
  8274. ### Class Methods
  8275. #### IsDisplayOnDesktop/0
  8276. > `public override bool IsDisplayOnDesktop()`
  8277. * Parameters
  8278. * _none_
  8279. * Returns
  8280. * `bool` - Returns true if the display is extending the desktop
  8281. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  8282. #### ShouldAppRenderWithLowResources/0
  8283. > `public override bool ShouldAppRenderWithLowResources()`
  8284. * Parameters
  8285. * _none_
  8286. * Returns
  8287. * `bool` - Returns true if the Unity app should render with low resources.
  8288. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  8289. #### ForceInterleavedReprojectionOn/1
  8290. > `public override void ForceInterleavedReprojectionOn(bool force)`
  8291. * Parameters
  8292. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  8293. * Returns
  8294. * _none_
  8295. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  8296. ---
  8297. ## Simulator Headset (SDK_SimHeadset)
  8298. > extends [SDK_BaseHeadset](#base-headset-sdk_baseheadset)
  8299. ### Overview
  8300. The Sim Headset SDK script provides dummy functions for the headset.
  8301. ### Class Methods
  8302. #### ProcessUpdate/1
  8303. > `public override void ProcessUpdate(Dictionary<string, object> options)`
  8304. * Parameters
  8305. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  8306. * Returns
  8307. * _none_
  8308. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  8309. #### ProcessFixedUpdate/1
  8310. > `public override void ProcessFixedUpdate(Dictionary<string, object> options)`
  8311. * Parameters
  8312. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  8313. * Returns
  8314. * _none_
  8315. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  8316. #### GetHeadset/0
  8317. > `public override Transform GetHeadset()`
  8318. * Parameters
  8319. * _none_
  8320. * Returns
  8321. * `Transform` - A transform of the object representing the headset in the scene.
  8322. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  8323. #### GetHeadsetCamera/0
  8324. > `public override Transform GetHeadsetCamera()`
  8325. * Parameters
  8326. * _none_
  8327. * Returns
  8328. * `Transform` - A transform of the object holding the headset camera in the scene.
  8329. The GetHeadsetCamera/0 method returns the Transform of the object that is used to hold the headset camera in the scene.
  8330. #### GetHeadsetType/0
  8331. > `public override string GetHeadsetType()`
  8332. * Parameters
  8333. * _none_
  8334. * Returns
  8335. * `string` - The string of the headset connected.
  8336. The GetHeadsetType method returns a string representing the type of headset connected.
  8337. #### GetHeadsetVelocity/0
  8338. > `public override Vector3 GetHeadsetVelocity()`
  8339. * Parameters
  8340. * _none_
  8341. * Returns
  8342. * `Vector3` - A Vector3 containing the current velocity of the headset.
  8343. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  8344. #### GetHeadsetAngularVelocity/0
  8345. > `public override Vector3 GetHeadsetAngularVelocity()`
  8346. * Parameters
  8347. * _none_
  8348. * Returns
  8349. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  8350. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  8351. #### HeadsetFade/3
  8352. > `public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)`
  8353. * Parameters
  8354. * `Color color` - The colour to fade to.
  8355. * `float duration` - The amount of time the fade should take to reach the given colour.
  8356. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  8357. * Returns
  8358. * _none_
  8359. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  8360. #### HasHeadsetFade/1
  8361. > `public override bool HasHeadsetFade(Transform obj)`
  8362. * Parameters
  8363. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  8364. * Returns
  8365. * `bool` - Returns true if the headset has fade functionality on it.
  8366. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  8367. #### AddHeadsetFade/1
  8368. > `public override void AddHeadsetFade(Transform camera)`
  8369. * Parameters
  8370. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  8371. * Returns
  8372. * _none_
  8373. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  8374. ---
  8375. ## Simulator Controller (SDK_SimController)
  8376. > extends [SDK_BaseController](#base-controller-sdk_basecontroller)
  8377. ### Overview
  8378. The Sim Controller SDK script provides functions to help simulate VR controllers.
  8379. ### Class Methods
  8380. #### ProcessUpdate/2
  8381. > `public override void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  8382. * Parameters
  8383. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  8384. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  8385. * Returns
  8386. * _none_
  8387. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  8388. #### ProcessFixedUpdate/2
  8389. > `public override void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  8390. * Parameters
  8391. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  8392. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  8393. * Returns
  8394. * _none_
  8395. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  8396. #### GetCurrentControllerType/1
  8397. > `public override ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  8398. * Parameters
  8399. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  8400. * Returns
  8401. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  8402. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  8403. #### GetControllerDefaultColliderPath/1
  8404. > `public override string GetControllerDefaultColliderPath(ControllerHand hand)`
  8405. * Parameters
  8406. * `ControllerHand hand` - The controller hand to check for
  8407. * Returns
  8408. * `string` - A path to the resource that contains the collider GameObject.
  8409. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  8410. #### GetControllerElementPath/3
  8411. > `public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)`
  8412. * Parameters
  8413. * `ControllerElements element` - The controller element to look up.
  8414. * `ControllerHand hand` - The controller hand to look up.
  8415. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  8416. * Returns
  8417. * `string` - A string containing the path to the game object that the controller element resides in.
  8418. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  8419. #### GetControllerIndex/1
  8420. > `public override uint GetControllerIndex(GameObject controller)`
  8421. * Parameters
  8422. * `GameObject controller` - The GameObject containing the controller.
  8423. * Returns
  8424. * `uint` - The index of the given controller.
  8425. The GetControllerIndex method returns the index of the given controller.
  8426. #### GetControllerByIndex/2
  8427. > `public override GameObject GetControllerByIndex(uint index, bool actual = false)`
  8428. * Parameters
  8429. * `uint index` - The index of the controller to find.
  8430. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  8431. * Returns
  8432. * `GameObject` - The GameObject of the controller
  8433. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  8434. #### GetControllerOrigin/1
  8435. > `public override Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  8436. * Parameters
  8437. * `VRTK_ControllerReference controllerReference` - The reference to the controller to retrieve the origin from.
  8438. * Returns
  8439. * `Transform` - A Transform containing the origin of the controller.
  8440. The GetControllerOrigin method returns the origin of the given controller.
  8441. #### GetControllerLeftHand/1
  8442. > `public override GameObject GetControllerLeftHand(bool actual = false)`
  8443. * Parameters
  8444. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  8445. * Returns
  8446. * `GameObject` - The GameObject containing the left hand controller.
  8447. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  8448. #### GetControllerRightHand/1
  8449. > `public override GameObject GetControllerRightHand(bool actual = false)`
  8450. * Parameters
  8451. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  8452. * Returns
  8453. * `GameObject` - The GameObject containing the right hand controller.
  8454. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  8455. #### IsControllerLeftHand/1
  8456. > `public override bool IsControllerLeftHand(GameObject controller)`
  8457. * Parameters
  8458. * `GameObject controller` - The GameObject to check.
  8459. * Returns
  8460. * `bool` - Returns true if the given controller is the left hand controller.
  8461. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  8462. #### IsControllerRightHand/1
  8463. > `public override bool IsControllerRightHand(GameObject controller)`
  8464. * Parameters
  8465. * `GameObject controller` - The GameObject to check.
  8466. * Returns
  8467. * `bool` - Returns true if the given controller is the right hand controller.
  8468. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  8469. #### IsControllerLeftHand/2
  8470. > `public override bool IsControllerLeftHand(GameObject controller, bool actual)`
  8471. * Parameters
  8472. * `GameObject controller` - The GameObject to check.
  8473. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  8474. * Returns
  8475. * `bool` - Returns true if the given controller is the left hand controller.
  8476. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  8477. #### IsControllerRightHand/2
  8478. > `public override bool IsControllerRightHand(GameObject controller, bool actual)`
  8479. * Parameters
  8480. * `GameObject controller` - The GameObject to check.
  8481. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  8482. * Returns
  8483. * `bool` - Returns true if the given controller is the right hand controller.
  8484. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  8485. #### WaitForControllerModel/1
  8486. > `public override bool WaitForControllerModel(ControllerHand hand)`
  8487. * Parameters
  8488. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  8489. * Returns
  8490. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  8491. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  8492. #### GetControllerModel/1
  8493. > `public override GameObject GetControllerModel(GameObject controller)`
  8494. * Parameters
  8495. * `GameObject controller` - The GameObject to get the model alias for.
  8496. * Returns
  8497. * `GameObject` - The GameObject that has the model alias within it.
  8498. The GetControllerModel method returns the model alias for the given GameObject.
  8499. #### GetControllerModel/1
  8500. > `public override GameObject GetControllerModel(ControllerHand hand)`
  8501. * Parameters
  8502. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  8503. * Returns
  8504. * `GameObject` - The GameObject that has the model alias within it.
  8505. The GetControllerModel method returns the model alias for the given controller hand.
  8506. #### GetControllerRenderModel/1
  8507. > `public override GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference)`
  8508. * Parameters
  8509. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check.
  8510. * Returns
  8511. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  8512. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  8513. #### SetControllerRenderModelWheel/2
  8514. > `public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)`
  8515. * Parameters
  8516. * `GameObject renderModel` - The GameObject containing the controller render model.
  8517. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  8518. * Returns
  8519. * _none_
  8520. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  8521. #### HapticPulse/2
  8522. > `public override void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5f)`
  8523. * Parameters
  8524. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  8525. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  8526. * Returns
  8527. * _none_
  8528. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  8529. #### HapticPulse/2
  8530. > `public override bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip)`
  8531. * Parameters
  8532. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  8533. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  8534. * Returns
  8535. * _none_
  8536. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  8537. #### GetHapticModifiers/0
  8538. > `public override SDK_ControllerHapticModifiers GetHapticModifiers()`
  8539. * Parameters
  8540. * _none_
  8541. * Returns
  8542. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  8543. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  8544. #### GetVelocity/1
  8545. > `public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference)`
  8546. * Parameters
  8547. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  8548. * Returns
  8549. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  8550. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  8551. #### GetAngularVelocity/1
  8552. > `public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)`
  8553. * Parameters
  8554. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  8555. * Returns
  8556. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  8557. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  8558. #### IsTouchpadStatic/4
  8559. > `public override bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity)`
  8560. * Parameters
  8561. * `Vector2 currentAxisValues` -
  8562. * `Vector2 previousAxisValues` -
  8563. * `int compareFidelity` -
  8564. * Returns
  8565. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  8566. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  8567. #### GetButtonAxis/2
  8568. > `public override Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  8569. * Parameters
  8570. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  8571. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  8572. * Returns
  8573. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  8574. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  8575. #### GetButtonSenseAxis/2
  8576. > `public override float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  8577. * Parameters
  8578. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  8579. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  8580. * Returns
  8581. * `float` - The current sense axis value.
  8582. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  8583. #### GetButtonHairlineDelta/2
  8584. > `public override float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  8585. * Parameters
  8586. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  8587. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  8588. * Returns
  8589. * `float` - The delta between the button presses.
  8590. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  8591. #### GetControllerButtonState/3
  8592. > `public override bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference)`
  8593. * Parameters
  8594. * `ButtonTypes buttonType` - The type of button to check for the state of.
  8595. * `ButtonPressTypes pressType` - The button state to check for.
  8596. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  8597. * Returns
  8598. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  8599. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  8600. ---
  8601. ## Simulator Boundaries (SDK_SimBoundaries)
  8602. > extends [SDK_BaseBoundaries](#base-boundaries-sdk_baseboundaries)
  8603. ### Overview
  8604. The Sim Boundaries SDK script provides dummy functions for the play area boundaries.
  8605. ### Class Methods
  8606. #### InitBoundaries/0
  8607. > `public override void InitBoundaries()`
  8608. * Parameters
  8609. * _none_
  8610. * Returns
  8611. * _none_
  8612. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  8613. #### GetPlayArea/0
  8614. > `public override Transform GetPlayArea()`
  8615. * Parameters
  8616. * _none_
  8617. * Returns
  8618. * `Transform` - A transform of the object representing the play area in the scene.
  8619. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  8620. #### GetPlayAreaVertices/0
  8621. > `public override Vector3[] GetPlayAreaVertices()`
  8622. * Parameters
  8623. * _none_
  8624. * Returns
  8625. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  8626. The GetPlayAreaVertices method returns the points of the play area boundaries.
  8627. #### GetPlayAreaBorderThickness/0
  8628. > `public override float GetPlayAreaBorderThickness()`
  8629. * Parameters
  8630. * _none_
  8631. * Returns
  8632. * `float` - The thickness of the drawn border.
  8633. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  8634. #### IsPlayAreaSizeCalibrated/0
  8635. > `public override bool IsPlayAreaSizeCalibrated()`
  8636. * Parameters
  8637. * _none_
  8638. * Returns
  8639. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  8640. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  8641. #### GetDrawAtRuntime/0
  8642. > `public override bool GetDrawAtRuntime()`
  8643. * Parameters
  8644. * _none_
  8645. * Returns
  8646. * `bool` - Returns true if the drawn border is being displayed.
  8647. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  8648. #### SetDrawAtRuntime/1
  8649. > `public override void SetDrawAtRuntime(bool value)`
  8650. * Parameters
  8651. * `bool value` - The state of whether the drawn border should be displayed or not.
  8652. * Returns
  8653. * _none_
  8654. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  8655. ---
  8656. # SteamVR SDK (VRTK/Source/SDK/SteamVR)
  8657. The scripts used to utilise the SteamVR Unity Plugin SDK.
  8658. * [SteamVR Defines](#steamvr-defines-sdk_steamvrdefines)
  8659. * [SteamVR System](#steamvr-system-sdk_steamvrsystem)
  8660. * [SteamVR Headset](#steamvr-headset-sdk_steamvrheadset)
  8661. * [SteamVR Controller](#steamvr-controller-sdk_steamvrcontroller)
  8662. * [SteamVR Boundaries](#steamvr-boundaries-sdk_steamvrboundaries)
  8663. ---
  8664. ## SteamVR Defines (SDK_SteamVRDefines)
  8665. ### Overview
  8666. Handles all the scripting define symbols for the SteamVR SDK.
  8667. ### Class Variables
  8668. * `public const string ScriptingDefineSymbol` - The scripting define symbol for the SteamVR SDK. Default: `SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "SDK_STEAMVR"`
  8669. ---
  8670. ## SteamVR System (SDK_SteamVRSystem)
  8671. ### Overview
  8672. The SteamVR System SDK script provides a bridge to the SteamVR SDK.
  8673. ### Class Methods
  8674. #### IsDisplayOnDesktop/0
  8675. > `public override bool IsDisplayOnDesktop()`
  8676. * Parameters
  8677. * _none_
  8678. * Returns
  8679. * `bool` - Returns true if the display is extending the desktop
  8680. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  8681. #### ShouldAppRenderWithLowResources/0
  8682. > `public override bool ShouldAppRenderWithLowResources()`
  8683. * Parameters
  8684. * _none_
  8685. * Returns
  8686. * `bool` - Returns true if the Unity app should render with low resources.
  8687. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  8688. #### ForceInterleavedReprojectionOn/1
  8689. > `public override void ForceInterleavedReprojectionOn(bool force)`
  8690. * Parameters
  8691. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  8692. * Returns
  8693. * _none_
  8694. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  8695. ---
  8696. ## SteamVR Headset (SDK_SteamVRHeadset)
  8697. ### Overview
  8698. The SteamVR Headset SDK script provides a bridge to the SteamVR SDK.
  8699. ### Class Methods
  8700. #### ProcessUpdate/1
  8701. > `public override void ProcessUpdate(Dictionary<string, object> options)`
  8702. * Parameters
  8703. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  8704. * Returns
  8705. * _none_
  8706. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  8707. #### ProcessFixedUpdate/1
  8708. > `public override void ProcessFixedUpdate(Dictionary<string, object> options)`
  8709. * Parameters
  8710. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  8711. * Returns
  8712. * _none_
  8713. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  8714. #### GetHeadset/0
  8715. > `public override Transform GetHeadset()`
  8716. * Parameters
  8717. * _none_
  8718. * Returns
  8719. * `Transform` - A transform of the object representing the headset in the scene.
  8720. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  8721. #### GetHeadsetCamera/0
  8722. > `public override Transform GetHeadsetCamera()`
  8723. * Parameters
  8724. * _none_
  8725. * Returns
  8726. * `Transform` - A transform of the object holding the headset camera in the scene.
  8727. The GetHeadsetCamera method returns the Transform of the object that is used to hold the headset camera in the scene.
  8728. #### GetHeadsetType/0
  8729. > `public override string GetHeadsetType()`
  8730. * Parameters
  8731. * _none_
  8732. * Returns
  8733. * `string` - The string of the headset connected.
  8734. The GetHeadsetType method returns a string representing the type of headset connected.
  8735. #### GetHeadsetVelocity/0
  8736. > `public override Vector3 GetHeadsetVelocity()`
  8737. * Parameters
  8738. * _none_
  8739. * Returns
  8740. * `Vector3` - A Vector3 containing the current velocity of the headset.
  8741. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  8742. #### GetHeadsetAngularVelocity/0
  8743. > `public override Vector3 GetHeadsetAngularVelocity()`
  8744. * Parameters
  8745. * _none_
  8746. * Returns
  8747. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  8748. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  8749. #### HeadsetFade/3
  8750. > `public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)`
  8751. * Parameters
  8752. * `Color color` - The colour to fade to.
  8753. * `float duration` - The amount of time the fade should take to reach the given colour.
  8754. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  8755. * Returns
  8756. * _none_
  8757. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  8758. #### HasHeadsetFade/1
  8759. > `public override bool HasHeadsetFade(Transform obj)`
  8760. * Parameters
  8761. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  8762. * Returns
  8763. * `bool` - Returns true if the headset has fade functionality on it.
  8764. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  8765. #### AddHeadsetFade/1
  8766. > `public override void AddHeadsetFade(Transform camera)`
  8767. * Parameters
  8768. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  8769. * Returns
  8770. * _none_
  8771. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  8772. ---
  8773. ## SteamVR Controller (SDK_SteamVRController)
  8774. ### Overview
  8775. The SteamVR Controller SDK script provides a bridge to SDK methods that deal with the input devices.
  8776. ### Class Methods
  8777. #### OnAfterSetupUnload/1
  8778. > `public override void OnAfterSetupUnload(VRTK_SDKSetup setup)`
  8779. * Parameters
  8780. * `VRTK_SDKSetup setup` - The SDK Setup which is using this SDK.
  8781. * Returns
  8782. * _none_
  8783. This method is called just after unloading the VRTK_SDKSetup that's using this SDK.
  8784. #### ProcessUpdate/2
  8785. > `public override void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  8786. * Parameters
  8787. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  8788. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  8789. * Returns
  8790. * _none_
  8791. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  8792. #### ProcessFixedUpdate/2
  8793. > `public override void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  8794. * Parameters
  8795. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  8796. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  8797. * Returns
  8798. * _none_
  8799. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  8800. #### GetCurrentControllerType/1
  8801. > `public override ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  8802. * Parameters
  8803. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  8804. * Returns
  8805. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  8806. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  8807. #### GetControllerDefaultColliderPath/1
  8808. > `public override string GetControllerDefaultColliderPath(ControllerHand hand)`
  8809. * Parameters
  8810. * `ControllerHand hand` - The controller hand to check for
  8811. * Returns
  8812. * `string` - A path to the resource that contains the collider GameObject.
  8813. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  8814. #### GetControllerElementPath/3
  8815. > `public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)`
  8816. * Parameters
  8817. * `ControllerElements element` - The controller element to look up.
  8818. * `ControllerHand hand` - The controller hand to look up.
  8819. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  8820. * Returns
  8821. * `string` - A string containing the path to the game object that the controller element resides in.
  8822. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  8823. #### GetControllerIndex/1
  8824. > `public override uint GetControllerIndex(GameObject controller)`
  8825. * Parameters
  8826. * `GameObject controller` - The GameObject containing the controller.
  8827. * Returns
  8828. * `uint` - The index of the given controller.
  8829. The GetControllerIndex method returns the index of the given controller.
  8830. #### GetControllerByIndex/2
  8831. > `public override GameObject GetControllerByIndex(uint index, bool actual = false)`
  8832. * Parameters
  8833. * `uint index` - The index of the controller to find.
  8834. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  8835. * Returns
  8836. * `GameObject` - The GameObject of the controller
  8837. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  8838. #### GetControllerOrigin/1
  8839. > `public override Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  8840. * Parameters
  8841. * `VRTK_ControllerReference controllerReference` - The reference to the controller to retrieve the origin from.
  8842. * Returns
  8843. * `Transform` - A Transform containing the origin of the controller.
  8844. The GetControllerOrigin method returns the origin of the given controller.
  8845. #### GetControllerLeftHand/1
  8846. > `public override GameObject GetControllerLeftHand(bool actual = false)`
  8847. * Parameters
  8848. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  8849. * Returns
  8850. * `GameObject` - The GameObject containing the left hand controller.
  8851. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  8852. #### GetControllerRightHand/1
  8853. > `public override GameObject GetControllerRightHand(bool actual = false)`
  8854. * Parameters
  8855. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  8856. * Returns
  8857. * `GameObject` - The GameObject containing the right hand controller.
  8858. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  8859. #### IsControllerLeftHand/1
  8860. > `public override bool IsControllerLeftHand(GameObject controller)`
  8861. * Parameters
  8862. * `GameObject controller` - The GameObject to check.
  8863. * Returns
  8864. * `bool` - Returns true if the given controller is the left hand controller.
  8865. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  8866. #### IsControllerRightHand/1
  8867. > `public override bool IsControllerRightHand(GameObject controller)`
  8868. * Parameters
  8869. * `GameObject controller` - The GameObject to check.
  8870. * Returns
  8871. * `bool` - Returns true if the given controller is the right hand controller.
  8872. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  8873. #### IsControllerLeftHand/2
  8874. > `public override bool IsControllerLeftHand(GameObject controller, bool actual)`
  8875. * Parameters
  8876. * `GameObject controller` - The GameObject to check.
  8877. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  8878. * Returns
  8879. * `bool` - Returns true if the given controller is the left hand controller.
  8880. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  8881. #### IsControllerRightHand/2
  8882. > `public override bool IsControllerRightHand(GameObject controller, bool actual)`
  8883. * Parameters
  8884. * `GameObject controller` - The GameObject to check.
  8885. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  8886. * Returns
  8887. * `bool` - Returns true if the given controller is the right hand controller.
  8888. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  8889. #### WaitForControllerModel/1
  8890. > `public override bool WaitForControllerModel(ControllerHand hand)`
  8891. * Parameters
  8892. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  8893. * Returns
  8894. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  8895. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  8896. #### GetControllerModel/1
  8897. > `public override GameObject GetControllerModel(GameObject controller)`
  8898. * Parameters
  8899. * `GameObject controller` - The GameObject to get the model alias for.
  8900. * Returns
  8901. * `GameObject` - The GameObject that has the model alias within it.
  8902. The GetControllerModel method returns the model alias for the given GameObject.
  8903. #### GetControllerModel/1
  8904. > `public override GameObject GetControllerModel(ControllerHand hand)`
  8905. * Parameters
  8906. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  8907. * Returns
  8908. * `GameObject` - The GameObject that has the model alias within it.
  8909. The GetControllerModel method returns the model alias for the given controller hand.
  8910. #### GetControllerRenderModel/1
  8911. > `public override GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference)`
  8912. * Parameters
  8913. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check.
  8914. * Returns
  8915. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  8916. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  8917. #### SetControllerRenderModelWheel/2
  8918. > `public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)`
  8919. * Parameters
  8920. * `GameObject renderModel` - The GameObject containing the controller render model.
  8921. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  8922. * Returns
  8923. * _none_
  8924. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  8925. #### HapticPulse/2
  8926. > `public override void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5f)`
  8927. * Parameters
  8928. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  8929. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  8930. * Returns
  8931. * _none_
  8932. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  8933. #### HapticPulse/2
  8934. > `public override bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip)`
  8935. * Parameters
  8936. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  8937. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  8938. * Returns
  8939. * _none_
  8940. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  8941. #### GetHapticModifiers/0
  8942. > `public override SDK_ControllerHapticModifiers GetHapticModifiers()`
  8943. * Parameters
  8944. * _none_
  8945. * Returns
  8946. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  8947. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  8948. #### GetVelocity/1
  8949. > `public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference)`
  8950. * Parameters
  8951. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  8952. * Returns
  8953. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  8954. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  8955. #### GetAngularVelocity/1
  8956. > `public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)`
  8957. * Parameters
  8958. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  8959. * Returns
  8960. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  8961. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  8962. #### IsTouchpadStatic/4
  8963. > `public override bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity)`
  8964. * Parameters
  8965. * `Vector2 currentAxisValues` -
  8966. * `Vector2 previousAxisValues` -
  8967. * `int compareFidelity` -
  8968. * Returns
  8969. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  8970. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  8971. #### GetButtonAxis/2
  8972. > `public override Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  8973. * Parameters
  8974. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  8975. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  8976. * Returns
  8977. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  8978. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  8979. #### GetButtonSenseAxis/2
  8980. > `public override float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  8981. * Parameters
  8982. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  8983. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  8984. * Returns
  8985. * `float` - The current sense axis value.
  8986. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  8987. #### GetButtonHairlineDelta/2
  8988. > `public override float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  8989. * Parameters
  8990. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  8991. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  8992. * Returns
  8993. * `float` - The delta between the button presses.
  8994. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  8995. #### GetControllerButtonState/3
  8996. > `public override bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference)`
  8997. * Parameters
  8998. * `ButtonTypes buttonType` - The type of button to check for the state of.
  8999. * `ButtonPressTypes pressType` - The button state to check for.
  9000. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  9001. * Returns
  9002. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  9003. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  9004. ---
  9005. ## SteamVR Boundaries (SDK_SteamVRBoundaries)
  9006. ### Overview
  9007. The SteamVR Boundaries SDK script provides a bridge to the SteamVR SDK play area.
  9008. ### Class Methods
  9009. #### InitBoundaries/0
  9010. > `public override void InitBoundaries()`
  9011. * Parameters
  9012. * _none_
  9013. * Returns
  9014. * _none_
  9015. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  9016. #### GetPlayArea/0
  9017. > `public override Transform GetPlayArea()`
  9018. * Parameters
  9019. * _none_
  9020. * Returns
  9021. * `Transform` - A transform of the object representing the play area in the scene.
  9022. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  9023. #### GetPlayAreaVertices/0
  9024. > `public override Vector3[] GetPlayAreaVertices()`
  9025. * Parameters
  9026. * _none_
  9027. * Returns
  9028. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  9029. The GetPlayAreaVertices method returns the points of the play area boundaries.
  9030. #### GetPlayAreaBorderThickness/0
  9031. > `public override float GetPlayAreaBorderThickness()`
  9032. * Parameters
  9033. * _none_
  9034. * Returns
  9035. * `float` - The thickness of the drawn border.
  9036. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  9037. #### IsPlayAreaSizeCalibrated/0
  9038. > `public override bool IsPlayAreaSizeCalibrated()`
  9039. * Parameters
  9040. * _none_
  9041. * Returns
  9042. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  9043. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  9044. #### GetDrawAtRuntime/0
  9045. > `public override bool GetDrawAtRuntime()`
  9046. * Parameters
  9047. * _none_
  9048. * Returns
  9049. * `bool` - Returns true if the drawn border is being displayed.
  9050. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  9051. #### SetDrawAtRuntime/1
  9052. > `public override void SetDrawAtRuntime(bool value)`
  9053. * Parameters
  9054. * `bool value` - The state of whether the drawn border should be displayed or not.
  9055. * Returns
  9056. * _none_
  9057. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  9058. ---
  9059. # Oculus SDK (VRTK/Source/SDK/Oculus)
  9060. The scripts used to utilise the Oculus Integration Unity Package SDK.
  9061. * [Oculus Defines](#oculus-defines-sdk_oculusdefines)
  9062. * [Oculus System](#oculus-system-sdk_oculussystem)
  9063. * [Oculus Headset](#oculus-headset-sdk_oculusheadset)
  9064. * [Oculus Controller](#oculus-controller-sdk_oculuscontroller)
  9065. * [Oculus Boundaries](#oculus-boundaries-sdk_oculusboundaries)
  9066. ---
  9067. ## Oculus Defines (SDK_OculusDefines)
  9068. ### Overview
  9069. Handles all the scripting define symbols for the Oculus and Avatar SDKs.
  9070. ### Class Variables
  9071. * `public const string ScriptingDefineSymbol` - The scripting define symbol for the Oculus SDK. Default: `SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "SDK_OCULUS"`
  9072. * `public const string AvatarScriptingDefineSymbol` - The scripting define symbol for the Oculus Avatar SDK. Default: `SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "SDK_OCULUS_AVATAR"`
  9073. ---
  9074. ## Oculus System (SDK_OculusSystem)
  9075. ### Overview
  9076. The Oculus System SDK script provides a bridge to the Oculus SDK.
  9077. ### Class Methods
  9078. #### IsDisplayOnDesktop/0
  9079. > `public override bool IsDisplayOnDesktop()`
  9080. * Parameters
  9081. * _none_
  9082. * Returns
  9083. * `bool` - Returns true if the display is extending the desktop
  9084. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  9085. #### ShouldAppRenderWithLowResources/0
  9086. > `public override bool ShouldAppRenderWithLowResources()`
  9087. * Parameters
  9088. * _none_
  9089. * Returns
  9090. * `bool` - Returns true if the Unity app should render with low resources.
  9091. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  9092. #### ForceInterleavedReprojectionOn/1
  9093. > `public override void ForceInterleavedReprojectionOn(bool force)`
  9094. * Parameters
  9095. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  9096. * Returns
  9097. * _none_
  9098. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  9099. ---
  9100. ## Oculus Headset (SDK_OculusHeadset)
  9101. ### Overview
  9102. The Oculus Headset SDK script provides a bridge to the Oculus SDK.
  9103. ### Class Methods
  9104. #### ProcessUpdate/1
  9105. > `public override void ProcessUpdate(Dictionary<string, object> options)`
  9106. * Parameters
  9107. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  9108. * Returns
  9109. * _none_
  9110. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  9111. #### ProcessFixedUpdate/1
  9112. > `public override void ProcessFixedUpdate(Dictionary<string, object> options)`
  9113. * Parameters
  9114. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  9115. * Returns
  9116. * _none_
  9117. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  9118. #### GetHeadset/0
  9119. > `public override Transform GetHeadset()`
  9120. * Parameters
  9121. * _none_
  9122. * Returns
  9123. * `Transform` - A transform of the object representing the headset in the scene.
  9124. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  9125. #### GetHeadsetCamera/0
  9126. > `public override Transform GetHeadsetCamera()`
  9127. * Parameters
  9128. * _none_
  9129. * Returns
  9130. * `Transform` - A transform of the object holding the headset camera in the scene.
  9131. The GetHeadsetCamera method returns the Transform of the object that is used to hold the headset camera in the scene.
  9132. #### GetHeadsetType/0
  9133. > `public override string GetHeadsetType()`
  9134. * Parameters
  9135. * _none_
  9136. * Returns
  9137. * `string` - The string of the headset connected.
  9138. The GetHeadsetType method returns a string representing the type of headset connected.
  9139. #### GetHeadsetVelocity/0
  9140. > `public override Vector3 GetHeadsetVelocity()`
  9141. * Parameters
  9142. * _none_
  9143. * Returns
  9144. * `Vector3` - A Vector3 containing the current velocity of the headset.
  9145. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  9146. #### GetHeadsetAngularVelocity/0
  9147. > `public override Vector3 GetHeadsetAngularVelocity()`
  9148. * Parameters
  9149. * _none_
  9150. * Returns
  9151. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  9152. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  9153. #### HeadsetFade/3
  9154. > `public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)`
  9155. * Parameters
  9156. * `Color color` - The colour to fade to.
  9157. * `float duration` - The amount of time the fade should take to reach the given colour.
  9158. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  9159. * Returns
  9160. * _none_
  9161. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  9162. #### HasHeadsetFade/1
  9163. > `public override bool HasHeadsetFade(Transform obj)`
  9164. * Parameters
  9165. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  9166. * Returns
  9167. * `bool` - Returns true if the headset has fade functionality on it.
  9168. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  9169. #### AddHeadsetFade/1
  9170. > `public override void AddHeadsetFade(Transform camera)`
  9171. * Parameters
  9172. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  9173. * Returns
  9174. * _none_
  9175. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  9176. ---
  9177. ## Oculus Controller (SDK_OculusController)
  9178. ### Overview
  9179. The Oculus Controller SDK script provides a bridge to SDK methods that deal with the input devices.
  9180. ### Class Methods
  9181. #### OnAfterSetupLoad/1
  9182. > `public override void OnAfterSetupLoad(VRTK_SDKSetup setup)`
  9183. * Parameters
  9184. * `VRTK_SDKSetup setup` - The SDK Setup which is using this SDK.
  9185. * Returns
  9186. * _none_
  9187. This method is called just after loading the VRTK_SDKSetup that's using this SDK.
  9188. #### ProcessUpdate/2
  9189. > `public override void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  9190. * Parameters
  9191. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  9192. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  9193. * Returns
  9194. * _none_
  9195. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  9196. #### ProcessFixedUpdate/2
  9197. > `public override void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  9198. * Parameters
  9199. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  9200. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  9201. * Returns
  9202. * _none_
  9203. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  9204. #### GetCurrentControllerType/1
  9205. > `public override ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  9206. * Parameters
  9207. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  9208. * Returns
  9209. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  9210. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  9211. #### GetControllerDefaultColliderPath/1
  9212. > `public override string GetControllerDefaultColliderPath(ControllerHand hand)`
  9213. * Parameters
  9214. * `ControllerHand hand` - The controller hand to check for
  9215. * Returns
  9216. * `string` - A path to the resource that contains the collider GameObject.
  9217. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  9218. #### GetControllerElementPath/3
  9219. > `public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)`
  9220. * Parameters
  9221. * `ControllerElements element` - The controller element to look up.
  9222. * `ControllerHand hand` - The controller hand to look up.
  9223. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  9224. * Returns
  9225. * `string` - A string containing the path to the game object that the controller element resides in.
  9226. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  9227. #### GetControllerIndex/1
  9228. > `public override uint GetControllerIndex(GameObject controller)`
  9229. * Parameters
  9230. * `GameObject controller` - The GameObject containing the controller.
  9231. * Returns
  9232. * `uint` - The index of the given controller.
  9233. The GetControllerIndex method returns the index of the given controller.
  9234. #### GetControllerByIndex/2
  9235. > `public override GameObject GetControllerByIndex(uint index, bool actual = false)`
  9236. * Parameters
  9237. * `uint index` - The index of the controller to find.
  9238. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  9239. * Returns
  9240. * `GameObject` - The GameObject of the controller
  9241. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  9242. #### GetControllerOrigin/1
  9243. > `public override Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  9244. * Parameters
  9245. * `VRTK_ControllerReference controllerReference` - The reference to the controller to retrieve the origin from.
  9246. * Returns
  9247. * `Transform` - A Transform containing the origin of the controller.
  9248. The GetControllerOrigin method returns the origin of the given controller.
  9249. #### GetControllerLeftHand/1
  9250. > `public override GameObject GetControllerLeftHand(bool actual = false)`
  9251. * Parameters
  9252. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  9253. * Returns
  9254. * `GameObject` - The GameObject containing the left hand controller.
  9255. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  9256. #### GetControllerRightHand/1
  9257. > `public override GameObject GetControllerRightHand(bool actual = false)`
  9258. * Parameters
  9259. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  9260. * Returns
  9261. * `GameObject` - The GameObject containing the right hand controller.
  9262. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  9263. #### IsControllerLeftHand/1
  9264. > `public override bool IsControllerLeftHand(GameObject controller)`
  9265. * Parameters
  9266. * `GameObject controller` - The GameObject to check.
  9267. * Returns
  9268. * `bool` - Returns true if the given controller is the left hand controller.
  9269. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  9270. #### IsControllerRightHand/1
  9271. > `public override bool IsControllerRightHand(GameObject controller)`
  9272. * Parameters
  9273. * `GameObject controller` - The GameObject to check.
  9274. * Returns
  9275. * `bool` - Returns true if the given controller is the right hand controller.
  9276. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  9277. #### IsControllerLeftHand/2
  9278. > `public override bool IsControllerLeftHand(GameObject controller, bool actual)`
  9279. * Parameters
  9280. * `GameObject controller` - The GameObject to check.
  9281. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  9282. * Returns
  9283. * `bool` - Returns true if the given controller is the left hand controller.
  9284. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  9285. #### IsControllerRightHand/2
  9286. > `public override bool IsControllerRightHand(GameObject controller, bool actual)`
  9287. * Parameters
  9288. * `GameObject controller` - The GameObject to check.
  9289. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  9290. * Returns
  9291. * `bool` - Returns true if the given controller is the right hand controller.
  9292. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  9293. #### WaitForControllerModel/1
  9294. > `public override bool WaitForControllerModel(ControllerHand hand)`
  9295. * Parameters
  9296. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  9297. * Returns
  9298. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  9299. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  9300. #### GetControllerModel/1
  9301. > `public override GameObject GetControllerModel(GameObject controller)`
  9302. * Parameters
  9303. * `GameObject controller` - The GameObject to get the model alias for.
  9304. * Returns
  9305. * `GameObject` - The GameObject that has the model alias within it.
  9306. The GetControllerModel method returns the model alias for the given GameObject.
  9307. #### GetControllerModel/1
  9308. > `public override GameObject GetControllerModel(ControllerHand hand)`
  9309. * Parameters
  9310. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  9311. * Returns
  9312. * `GameObject` - The GameObject that has the model alias within it.
  9313. The GetControllerModel method returns the model alias for the given controller hand.
  9314. #### GetControllerRenderModel/1
  9315. > `public override GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference)`
  9316. * Parameters
  9317. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check.
  9318. * Returns
  9319. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  9320. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  9321. #### SetControllerRenderModelWheel/2
  9322. > `public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)`
  9323. * Parameters
  9324. * `GameObject renderModel` - The GameObject containing the controller render model.
  9325. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  9326. * Returns
  9327. * _none_
  9328. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  9329. #### HapticPulse/2
  9330. > `public override void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5f)`
  9331. * Parameters
  9332. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  9333. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  9334. * Returns
  9335. * _none_
  9336. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  9337. #### HapticPulse/2
  9338. > `public override bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip)`
  9339. * Parameters
  9340. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  9341. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  9342. * Returns
  9343. * _none_
  9344. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  9345. #### GetHapticModifiers/0
  9346. > `public override SDK_ControllerHapticModifiers GetHapticModifiers()`
  9347. * Parameters
  9348. * _none_
  9349. * Returns
  9350. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  9351. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  9352. #### GetVelocity/1
  9353. > `public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference)`
  9354. * Parameters
  9355. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  9356. * Returns
  9357. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  9358. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  9359. #### GetAngularVelocity/1
  9360. > `public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)`
  9361. * Parameters
  9362. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  9363. * Returns
  9364. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  9365. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  9366. #### IsTouchpadStatic/4
  9367. > `public override bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity)`
  9368. * Parameters
  9369. * `Vector2 currentAxisValues` -
  9370. * `Vector2 previousAxisValues` -
  9371. * `int compareFidelity` -
  9372. * Returns
  9373. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  9374. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  9375. #### GetButtonAxis/2
  9376. > `public override Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  9377. * Parameters
  9378. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  9379. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  9380. * Returns
  9381. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  9382. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  9383. #### GetButtonSenseAxis/2
  9384. > `public override float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  9385. * Parameters
  9386. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  9387. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  9388. * Returns
  9389. * `float` - The current sense axis value.
  9390. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  9391. #### GetButtonHairlineDelta/2
  9392. > `public override float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  9393. * Parameters
  9394. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  9395. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  9396. * Returns
  9397. * `float` - The delta between the button presses.
  9398. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  9399. #### GetControllerButtonState/3
  9400. > `public override bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference)`
  9401. * Parameters
  9402. * `ButtonTypes buttonType` - The type of button to check for the state of.
  9403. * `ButtonPressTypes pressType` - The button state to check for.
  9404. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  9405. * Returns
  9406. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  9407. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  9408. ---
  9409. ## Oculus Boundaries (SDK_OculusBoundaries)
  9410. ### Overview
  9411. The Oculus Boundaries SDK script provides a bridge to the Oculus SDK play area.
  9412. ### Class Methods
  9413. #### InitBoundaries/0
  9414. > `public override void InitBoundaries()`
  9415. * Parameters
  9416. * _none_
  9417. * Returns
  9418. * _none_
  9419. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  9420. #### GetPlayArea/0
  9421. > `public override Transform GetPlayArea()`
  9422. * Parameters
  9423. * _none_
  9424. * Returns
  9425. * `Transform` - A transform of the object representing the play area in the scene.
  9426. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  9427. #### GetPlayAreaVertices/0
  9428. > `public override Vector3[] GetPlayAreaVertices()`
  9429. * Parameters
  9430. * _none_
  9431. * Returns
  9432. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  9433. The GetPlayAreaVertices method returns the points of the play area boundaries.
  9434. #### GetPlayAreaBorderThickness/0
  9435. > `public override float GetPlayAreaBorderThickness()`
  9436. * Parameters
  9437. * _none_
  9438. * Returns
  9439. * `float` - The thickness of the drawn border.
  9440. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  9441. #### IsPlayAreaSizeCalibrated/0
  9442. > `public override bool IsPlayAreaSizeCalibrated()`
  9443. * Parameters
  9444. * _none_
  9445. * Returns
  9446. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  9447. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  9448. #### GetDrawAtRuntime/0
  9449. > `public override bool GetDrawAtRuntime()`
  9450. * Parameters
  9451. * _none_
  9452. * Returns
  9453. * `bool` - Returns true if the drawn border is being displayed.
  9454. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  9455. #### SetDrawAtRuntime/1
  9456. > `public override void SetDrawAtRuntime(bool value)`
  9457. * Parameters
  9458. * `bool value` - The state of whether the drawn border should be displayed or not.
  9459. * Returns
  9460. * _none_
  9461. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  9462. #### GetAvatar/0
  9463. > `public virtual OvrAvatar GetAvatar()`
  9464. * Parameters
  9465. * _none_
  9466. * Returns
  9467. * `OvrAvatar` - The OvrAvatar script for managing the Oculus Avatar.
  9468. The GetAvatar method is used to retrieve the Oculus Avatar object if it exists in the scene. This method is only available if the Oculus Avatar package is installed.
  9469. ---
  9470. # WindowsMR SDK (VRTK/Source/SDK/WindowsMR)
  9471. The scripts used to utilise Windows Mixed Reality Unity SDK.
  9472. * [WindowsMR Defines](#windowsmr-defines-sdk_windowsmrdefines)
  9473. * [WindowsMR System](#windowsmr-system-sdk_windowsmr)
  9474. * [WindowsMR Headset](#windowsmr-headset-sdk_windowsmrheadset)
  9475. * [WindowsMR Controller](#windowsmr-controller-sdk_windowsmrcontroller)
  9476. * [WindowsMR Boundaries](#windowsmr-boundaries-sdk_windowsmrboundaries)
  9477. ---
  9478. ## WindowsMR Defines (SDK_WindowsMRDefines)
  9479. ### Overview
  9480. Handles all the scripting define symbols for the Windows Immersive Mixed Reality SDK.
  9481. ### Class Variables
  9482. * `public const string ScriptingDefineSymbol` - The scripting define symbol for the Immersive Mixed Reality SDK. Default: `SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "SDK_WINDOWSMR"`
  9483. ---
  9484. ## WindowsMR System (SDK_WindowsMR)
  9485. ### Overview
  9486. The Windows Mixed Reality System SDK script provides a bridge to the Windows Mixed Reality Unity SDK.
  9487. ### Class Methods
  9488. #### ForceInterleavedReprojectionOn/1
  9489. > `public override void ForceInterleavedReprojectionOn(bool force)`
  9490. * Parameters
  9491. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  9492. * Returns
  9493. * _none_
  9494. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  9495. #### IsDisplayOnDesktop/0
  9496. > `public override bool IsDisplayOnDesktop()`
  9497. * Parameters
  9498. * _none_
  9499. * Returns
  9500. * `bool` - Returns true if the display is extending the desktop
  9501. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  9502. #### ShouldAppRenderWithLowResources/0
  9503. > `public override bool ShouldAppRenderWithLowResources()`
  9504. * Parameters
  9505. * _none_
  9506. * Returns
  9507. * `bool` - Returns true if the Unity app should render with low resources.
  9508. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  9509. ---
  9510. ## WindowsMR Headset (SDK_WindowsMRHeadset)
  9511. ### Overview
  9512. The WindowsMR Headset SDK script provides a bridge to the WindowsMR XR.
  9513. ### Class Methods
  9514. #### ProcessFixedUpdate/1
  9515. > `public override void ProcessFixedUpdate(Dictionary<string, object> options)`
  9516. * Parameters
  9517. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  9518. * Returns
  9519. * _none_
  9520. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  9521. #### ProcessUpdate/1
  9522. > `public override void ProcessUpdate(Dictionary<string, object> options)`
  9523. * Parameters
  9524. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  9525. * Returns
  9526. * _none_
  9527. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  9528. #### GetHeadset/0
  9529. > `public override Transform GetHeadset()`
  9530. * Parameters
  9531. * _none_
  9532. * Returns
  9533. * `Transform` - A transform of the object representing the headset in the scene.
  9534. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  9535. #### GetHeadsetAngularVelocity/0
  9536. > `public override Vector3 GetHeadsetAngularVelocity()`
  9537. * Parameters
  9538. * _none_
  9539. * Returns
  9540. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  9541. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  9542. #### GetHeadsetCamera/0
  9543. > `public override Transform GetHeadsetCamera()`
  9544. * Parameters
  9545. * _none_
  9546. * Returns
  9547. * `Transform` - A transform of the object holding the headset camera in the scene.
  9548. The GetHeadsetCamera method returns the Transform of the object that is used to hold the headset camera in the scene.
  9549. #### GetHeadsetVelocity/0
  9550. > `public override Vector3 GetHeadsetVelocity()`
  9551. * Parameters
  9552. * _none_
  9553. * Returns
  9554. * `Vector3` - A Vector3 containing the current velocity of the headset.
  9555. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  9556. #### HasHeadsetFade/1
  9557. > `public override bool HasHeadsetFade(Transform obj)`
  9558. * Parameters
  9559. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  9560. * Returns
  9561. * `bool` - Returns true if the headset has fade functionality on it.
  9562. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  9563. #### HeadsetFade/3
  9564. > `public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)`
  9565. * Parameters
  9566. * `Color color` - The colour to fade to.
  9567. * `float duration` - The amount of time the fade should take to reach the given colour.
  9568. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  9569. * Returns
  9570. * _none_
  9571. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  9572. #### AddHeadsetFade/1
  9573. > `public override void AddHeadsetFade(Transform camera)`
  9574. * Parameters
  9575. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  9576. * Returns
  9577. * _none_
  9578. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  9579. #### GetHeadsetType/0
  9580. > `public override string GetHeadsetType()`
  9581. * Parameters
  9582. * _none_
  9583. * Returns
  9584. * `string` - The string of the headset connected.
  9585. The GetHeadsetType method returns a string representing the type of headset connected.
  9586. ---
  9587. ## WindowsMR Controller (SDK_WindowsMRController)
  9588. ### Overview
  9589. The WindowsMR Controller SDK script provides a bridge to SDK methods that deal with the input devices.
  9590. ### Class Methods
  9591. #### GetAngularVelocity/1
  9592. > `public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)`
  9593. * Parameters
  9594. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  9595. * Returns
  9596. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  9597. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  9598. #### GetButtonAxis/2
  9599. > `public override Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  9600. * Parameters
  9601. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  9602. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  9603. * Returns
  9604. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  9605. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  9606. #### GetButtonSenseAxis/2
  9607. > `public override float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  9608. * Parameters
  9609. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  9610. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  9611. * Returns
  9612. * `float` - The current sense axis value.
  9613. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  9614. #### GetButtonHairlineDelta/2
  9615. > `public override float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  9616. * Parameters
  9617. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  9618. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  9619. * Returns
  9620. * `float` - The delta between the button presses.
  9621. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  9622. #### GetControllerButtonState/3
  9623. > `public override bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference)`
  9624. * Parameters
  9625. * `ButtonTypes buttonType` - The type of button to check for the state of.
  9626. * `ButtonPressTypes pressType` - The button state to check for.
  9627. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  9628. * Returns
  9629. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  9630. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  9631. #### GetControllerByIndex/2
  9632. > `public override GameObject GetControllerByIndex(uint index, bool actual = false)`
  9633. * Parameters
  9634. * `uint index` - The index of the controller to find.
  9635. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  9636. * Returns
  9637. * `GameObject` - The GameObject of the controller
  9638. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  9639. #### GetControllerDefaultColliderPath/1
  9640. > `public override string GetControllerDefaultColliderPath(ControllerHand hand)`
  9641. * Parameters
  9642. * `ControllerHand hand` - The controller hand to check for
  9643. * Returns
  9644. * `string` - A path to the resource that contains the collider GameObject.
  9645. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  9646. #### GetControllerElementPath/3
  9647. > `public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)`
  9648. * Parameters
  9649. * `ControllerElements element` - The controller element to look up.
  9650. * `ControllerHand hand` - The controller hand to look up.
  9651. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  9652. * Returns
  9653. * `string` - A string containing the path to the game object that the controller element resides in.
  9654. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  9655. #### GetControllerIndex/1
  9656. > `public override uint GetControllerIndex(GameObject controller)`
  9657. * Parameters
  9658. * `GameObject controller` - The GameObject containing the controller.
  9659. * Returns
  9660. * `uint` - The index of the given controller.
  9661. The GetControllerIndex method returns the index of the given controller.
  9662. #### GetControllerLeftHand/1
  9663. > `public override GameObject GetControllerLeftHand(bool actual = false)`
  9664. * Parameters
  9665. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  9666. * Returns
  9667. * `GameObject` - The GameObject containing the left hand controller.
  9668. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  9669. #### GetControllerModel/1
  9670. > `public override GameObject GetControllerModel(GameObject controller)`
  9671. * Parameters
  9672. * `GameObject controller` - The GameObject to get the model alias for.
  9673. * Returns
  9674. * `GameObject` - The GameObject that has the model alias within it.
  9675. The GetControllerModel method returns the model alias for the given GameObject.
  9676. #### GetControllerModel/1
  9677. > `public override GameObject GetControllerModel(ControllerHand hand)`
  9678. * Parameters
  9679. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  9680. * Returns
  9681. * `GameObject` - The GameObject that has the model alias within it.
  9682. The GetControllerModel method returns the model alias for the given controller hand.
  9683. #### GetControllerOrigin/1
  9684. > `public override Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  9685. * Parameters
  9686. * `VRTK_ControllerReference controllerReference` - The reference to the controller to retrieve the origin from.
  9687. * Returns
  9688. * `Transform` - A Transform containing the origin of the controller.
  9689. The GetControllerOrigin method returns the origin of the given controller.
  9690. #### GetControllerRenderModel/1
  9691. > `public override GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference)`
  9692. * Parameters
  9693. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check.
  9694. * Returns
  9695. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  9696. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  9697. #### GetControllerRightHand/1
  9698. > `public override GameObject GetControllerRightHand(bool actual = false)`
  9699. * Parameters
  9700. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  9701. * Returns
  9702. * `GameObject` - The GameObject containing the right hand controller.
  9703. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  9704. #### GetCurrentControllerType/1
  9705. > `public override ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  9706. * Parameters
  9707. * _none_
  9708. * Returns
  9709. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  9710. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  9711. #### GetHapticModifiers/0
  9712. > `public override SDK_ControllerHapticModifiers GetHapticModifiers()`
  9713. * Parameters
  9714. * _none_
  9715. * Returns
  9716. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  9717. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  9718. #### GetVelocity/1
  9719. > `public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference)`
  9720. * Parameters
  9721. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  9722. * Returns
  9723. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  9724. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  9725. #### HapticPulse/2
  9726. > `public override void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5F)`
  9727. * Parameters
  9728. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  9729. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  9730. * Returns
  9731. * _none_
  9732. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  9733. #### HapticPulse/2
  9734. > `public override bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip)`
  9735. * Parameters
  9736. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  9737. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  9738. * Returns
  9739. * _none_
  9740. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  9741. #### IsControllerLeftHand/1
  9742. > `public override bool IsControllerLeftHand(GameObject controller)`
  9743. * Parameters
  9744. * `GameObject controller` - The GameObject to check.
  9745. * Returns
  9746. * `bool` - Returns true if the given controller is the left hand controller.
  9747. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  9748. #### IsControllerLeftHand/2
  9749. > `public override bool IsControllerLeftHand(GameObject controller, bool actual)`
  9750. * Parameters
  9751. * `GameObject controller` - The GameObject to check.
  9752. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  9753. * Returns
  9754. * `bool` - Returns true if the given controller is the left hand controller.
  9755. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  9756. #### IsControllerRightHand/1
  9757. > `public override bool IsControllerRightHand(GameObject controller)`
  9758. * Parameters
  9759. * `GameObject controller` - The GameObject to check.
  9760. * Returns
  9761. * `bool` - Returns true if the given controller is the right hand controller.
  9762. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  9763. #### IsControllerRightHand/2
  9764. > `public override bool IsControllerRightHand(GameObject controller, bool actual)`
  9765. * Parameters
  9766. * `GameObject controller` - The GameObject to check.
  9767. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  9768. * Returns
  9769. * `bool` - Returns true if the given controller is the right hand controller.
  9770. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  9771. #### IsTouchpadStatic/4
  9772. > `public override bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity)`
  9773. * Parameters
  9774. * `Vector2 currentAxisValues` -
  9775. * `Vector2 previousAxisValues` -
  9776. * `int compareFidelity` -
  9777. * Returns
  9778. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  9779. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  9780. #### ProcessFixedUpdate/2
  9781. > `public override void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  9782. * Parameters
  9783. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  9784. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  9785. * Returns
  9786. * _none_
  9787. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  9788. #### ProcessUpdate/2
  9789. > `public override void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  9790. * Parameters
  9791. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  9792. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  9793. * Returns
  9794. * _none_
  9795. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  9796. #### SetControllerRenderModelWheel/2
  9797. > `public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)`
  9798. * Parameters
  9799. * `GameObject renderModel` - The GameObject containing the controller render model.
  9800. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  9801. * Returns
  9802. * _none_
  9803. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  9804. #### WaitForControllerModel/1
  9805. > `public override bool WaitForControllerModel(ControllerHand hand)`
  9806. * Parameters
  9807. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  9808. * Returns
  9809. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  9810. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  9811. ---
  9812. ## WindowsMR Boundaries (SDK_WindowsMRBoundaries)
  9813. ### Overview
  9814. The WindowsMR Boundaries SDK script provides a bridge to the Windows Mixed Reality SDK play area.
  9815. ### Class Methods
  9816. #### GetDrawAtRuntime/0
  9817. > `public override bool GetDrawAtRuntime()`
  9818. * Parameters
  9819. * _none_
  9820. * Returns
  9821. * `bool` - Returns true if the drawn border is being displayed.
  9822. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  9823. #### GetPlayArea/0
  9824. > `public override Transform GetPlayArea()`
  9825. * Parameters
  9826. * _none_
  9827. * Returns
  9828. * `Transform` - A transform of the object representing the play area in the scene.
  9829. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  9830. #### GetPlayAreaBorderThickness/0
  9831. > `public override float GetPlayAreaBorderThickness()`
  9832. * Parameters
  9833. * _none_
  9834. * Returns
  9835. * `float` - The thickness of the drawn border.
  9836. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  9837. #### GetPlayAreaVertices/0
  9838. > `public override Vector3[] GetPlayAreaVertices()`
  9839. * Parameters
  9840. * _none_
  9841. * Returns
  9842. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  9843. The GetPlayAreaVertices method returns the points of the play area boundaries.
  9844. #### InitBoundaries/0
  9845. > `public override void InitBoundaries()`
  9846. * Parameters
  9847. * _none_
  9848. * Returns
  9849. * _none_
  9850. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  9851. #### IsPlayAreaSizeCalibrated/0
  9852. > `public override bool IsPlayAreaSizeCalibrated()`
  9853. * Parameters
  9854. * _none_
  9855. * Returns
  9856. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  9857. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  9858. #### SetDrawAtRuntime/1
  9859. > `public override void SetDrawAtRuntime(bool value)`
  9860. * Parameters
  9861. * `bool value` - The state of whether the drawn border should be displayed or not.
  9862. * Returns
  9863. * _none_
  9864. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  9865. ---
  9866. # Daydream SDK (VRTK/Source/SDK/Daydream)
  9867. The scripts used to utilise the Google VR SDK for Unity.
  9868. * [Daydream Defines](#daydream-defines-sdk_daydreamdefines)
  9869. * [Daydream System](#daydream-system-sdk_daydreamsystem)
  9870. * [Daydream Headset](#daydream-headset-sdk_daydreamheadset)
  9871. * [Daydream Controller](#daydream-controller-sdk_daydreamcontroller)
  9872. * [Daydream Boundaries](#daydream-boundaries-sdk_daydreamboundaries)
  9873. ---
  9874. ## Daydream Defines (SDK_DaydreamDefines)
  9875. ### Overview
  9876. Handles all the scripting define symbols for the Daydream SDK.
  9877. ### Class Variables
  9878. * `public const string ScriptingDefineSymbol` - The scripting define symbol for the Daydream SDK. Default: `SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "SDK_DAYDREAM"`
  9879. ---
  9880. ## Daydream System (SDK_DaydreamSystem)
  9881. ### Overview
  9882. The Daydream System SDK script provides dummy functions for system functions.
  9883. ### Class Methods
  9884. #### IsDisplayOnDesktop/0
  9885. > `public override bool IsDisplayOnDesktop()`
  9886. * Parameters
  9887. * _none_
  9888. * Returns
  9889. * `bool` - Returns true if the display is extending the desktop
  9890. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  9891. #### ShouldAppRenderWithLowResources/0
  9892. > `public override bool ShouldAppRenderWithLowResources()`
  9893. * Parameters
  9894. * _none_
  9895. * Returns
  9896. * `bool` - Returns true if the Unity app should render with low resources.
  9897. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  9898. #### ForceInterleavedReprojectionOn/1
  9899. > `public override void ForceInterleavedReprojectionOn(bool force)`
  9900. * Parameters
  9901. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  9902. * Returns
  9903. * _none_
  9904. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  9905. ---
  9906. ## Daydream Headset (SDK_DaydreamHeadset)
  9907. ### Overview
  9908. The Daydream Headset SDK script provides dummy functions for the headset.
  9909. ### Class Methods
  9910. #### ProcessUpdate/1
  9911. > `public override void ProcessUpdate(Dictionary<string, object> options)`
  9912. * Parameters
  9913. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  9914. * Returns
  9915. * _none_
  9916. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  9917. #### ProcessFixedUpdate/1
  9918. > `public override void ProcessFixedUpdate(Dictionary<string, object> options)`
  9919. * Parameters
  9920. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  9921. * Returns
  9922. * _none_
  9923. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  9924. #### GetHeadset/0
  9925. > `public override Transform GetHeadset()`
  9926. * Parameters
  9927. * _none_
  9928. * Returns
  9929. * `Transform` - A transform of the object representing the headset in the scene.
  9930. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  9931. #### GetHeadsetCamera/0
  9932. > `public override Transform GetHeadsetCamera()`
  9933. * Parameters
  9934. * _none_
  9935. * Returns
  9936. * `Transform` - A transform of the object holding the headset camera in the scene.
  9937. The GetHeadsetCamera/0 method returns the Transform of the object that is used to hold the headset camera in the scene.
  9938. #### GetHeadsetType/0
  9939. > `public override string GetHeadsetType()`
  9940. * Parameters
  9941. * _none_
  9942. * Returns
  9943. * `string` - The string of the headset connected.
  9944. The GetHeadsetType method returns a string representing the type of headset connected.
  9945. #### GetHeadsetVelocity/0
  9946. > `public override Vector3 GetHeadsetVelocity()`
  9947. * Parameters
  9948. * _none_
  9949. * Returns
  9950. * `Vector3` - A Vector3 containing the current velocity of the headset.
  9951. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  9952. #### GetHeadsetAngularVelocity/0
  9953. > `public override Vector3 GetHeadsetAngularVelocity()`
  9954. * Parameters
  9955. * _none_
  9956. * Returns
  9957. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  9958. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  9959. #### HeadsetFade/3
  9960. > `public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)`
  9961. * Parameters
  9962. * `Color color` - The colour to fade to.
  9963. * `float duration` - The amount of time the fade should take to reach the given colour.
  9964. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  9965. * Returns
  9966. * _none_
  9967. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  9968. #### HasHeadsetFade/1
  9969. > `public override bool HasHeadsetFade(Transform obj)`
  9970. * Parameters
  9971. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  9972. * Returns
  9973. * `bool` - Returns true if the headset has fade functionality on it.
  9974. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  9975. #### AddHeadsetFade/1
  9976. > `public override void AddHeadsetFade(Transform camera)`
  9977. * Parameters
  9978. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  9979. * Returns
  9980. * _none_
  9981. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  9982. ---
  9983. ## Daydream Controller (SDK_DaydreamController)
  9984. ### Overview
  9985. The Daydream Controller SDK script provides a bridge to SDK methods that deal with the input devices.
  9986. ### Class Methods
  9987. #### ProcessUpdate/2
  9988. > `public override void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  9989. * Parameters
  9990. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  9991. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  9992. * Returns
  9993. * _none_
  9994. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  9995. #### ProcessFixedUpdate/2
  9996. > `public override void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  9997. * Parameters
  9998. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  9999. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  10000. * Returns
  10001. * _none_
  10002. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  10003. #### GetCurrentControllerType/1
  10004. > `public override ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  10005. * Parameters
  10006. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  10007. * Returns
  10008. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  10009. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  10010. #### GetControllerDefaultColliderPath/1
  10011. > `public override string GetControllerDefaultColliderPath(ControllerHand hand)`
  10012. * Parameters
  10013. * `ControllerHand hand` - The controller hand to check for
  10014. * Returns
  10015. * `string` - A path to the resource that contains the collider GameObject.
  10016. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  10017. #### GetControllerElementPath/3
  10018. > `public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)`
  10019. * Parameters
  10020. * `ControllerElements element` - The controller element to look up.
  10021. * `ControllerHand hand` - The controller hand to look up.
  10022. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  10023. * Returns
  10024. * `string` - A string containing the path to the game object that the controller element resides in.
  10025. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  10026. #### GetControllerIndex/1
  10027. > `public override uint GetControllerIndex(GameObject controller)`
  10028. * Parameters
  10029. * `GameObject controller` - The GameObject containing the controller.
  10030. * Returns
  10031. * `uint` - The index of the given controller.
  10032. The GetControllerIndex method returns the index of the given controller.
  10033. #### GetControllerByIndex/2
  10034. > `public override GameObject GetControllerByIndex(uint index, bool actual = false)`
  10035. * Parameters
  10036. * `uint index` - The index of the controller to find.
  10037. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  10038. * Returns
  10039. * `GameObject` -
  10040. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  10041. #### GetControllerOrigin/1
  10042. > `public override Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  10043. * Parameters
  10044. * `VRTK_ControllerReference controllerReference` - The reference to the controller to retrieve the origin from.
  10045. * Returns
  10046. * `Transform` - A Transform containing the origin of the controller.
  10047. The GetControllerOrigin method returns the origin of the given controller.
  10048. #### GetControllerLeftHand/1
  10049. > `public override GameObject GetControllerLeftHand(bool actual = false)`
  10050. * Parameters
  10051. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  10052. * Returns
  10053. * `GameObject` - The GameObject containing the left hand controller.
  10054. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  10055. #### GetControllerRightHand/1
  10056. > `public override GameObject GetControllerRightHand(bool actual = false)`
  10057. * Parameters
  10058. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  10059. * Returns
  10060. * `GameObject` - The GameObject containing the right hand controller.
  10061. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  10062. #### IsControllerLeftHand/1
  10063. > `public override bool IsControllerLeftHand(GameObject controller)`
  10064. * Parameters
  10065. * `GameObject controller` - The GameObject to check.
  10066. * Returns
  10067. * `bool` - Returns true if the given controller is the left hand controller.
  10068. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  10069. #### IsControllerRightHand/1
  10070. > `public override bool IsControllerRightHand(GameObject controller)`
  10071. * Parameters
  10072. * `GameObject controller` - The GameObject to check.
  10073. * Returns
  10074. * `bool` - Returns true if the given controller is the right hand controller.
  10075. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  10076. #### IsControllerLeftHand/2
  10077. > `public override bool IsControllerLeftHand(GameObject controller, bool actual)`
  10078. * Parameters
  10079. * `GameObject controller` - The GameObject to check.
  10080. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  10081. * Returns
  10082. * `bool` - Returns true if the given controller is the left hand controller.
  10083. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  10084. #### IsControllerRightHand/2
  10085. > `public override bool IsControllerRightHand(GameObject controller, bool actual)`
  10086. * Parameters
  10087. * `GameObject controller` - The GameObject to check.
  10088. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  10089. * Returns
  10090. * `bool` - Returns true if the given controller is the right hand controller.
  10091. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  10092. #### WaitForControllerModel/1
  10093. > `public override bool WaitForControllerModel(ControllerHand hand)`
  10094. * Parameters
  10095. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  10096. * Returns
  10097. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  10098. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  10099. #### GetControllerModel/1
  10100. > `public override GameObject GetControllerModel(GameObject controller)`
  10101. * Parameters
  10102. * `GameObject controller` - The GameObject to get the model alias for.
  10103. * Returns
  10104. * `GameObject` - The GameObject that has the model alias within it.
  10105. The GetControllerModel method returns the model alias for the given GameObject.
  10106. #### GetControllerModel/1
  10107. > `public override GameObject GetControllerModel(ControllerHand hand)`
  10108. * Parameters
  10109. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  10110. * Returns
  10111. * `GameObject` - The GameObject that has the model alias within it.
  10112. The GetControllerModel method returns the model alias for the given controller hand.
  10113. #### GetControllerRenderModel/1
  10114. > `public override GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference)`
  10115. * Parameters
  10116. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check.
  10117. * Returns
  10118. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  10119. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  10120. #### SetControllerRenderModelWheel/2
  10121. > `public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)`
  10122. * Parameters
  10123. * `GameObject renderModel` - The GameObject containing the controller render model.
  10124. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  10125. * Returns
  10126. * _none_
  10127. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  10128. #### HapticPulse/2
  10129. > `public override void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5f)`
  10130. * Parameters
  10131. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  10132. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  10133. * Returns
  10134. * _none_
  10135. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  10136. #### HapticPulse/2
  10137. > `public override bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip)`
  10138. * Parameters
  10139. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  10140. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  10141. * Returns
  10142. * _none_
  10143. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  10144. #### GetHapticModifiers/0
  10145. > `public override SDK_ControllerHapticModifiers GetHapticModifiers()`
  10146. * Parameters
  10147. * _none_
  10148. * Returns
  10149. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  10150. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  10151. #### GetVelocity/1
  10152. > `public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference)`
  10153. * Parameters
  10154. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  10155. * Returns
  10156. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  10157. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  10158. #### GetAngularVelocity/1
  10159. > `public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)`
  10160. * Parameters
  10161. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  10162. * Returns
  10163. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  10164. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  10165. #### IsTouchpadStatic/4
  10166. > `public override bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity)`
  10167. * Parameters
  10168. * `Vector2 currentAxisValues` -
  10169. * `Vector2 previousAxisValues` -
  10170. * `int compareFidelity` -
  10171. * Returns
  10172. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  10173. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  10174. #### GetButtonAxis/2
  10175. > `public override Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  10176. * Parameters
  10177. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  10178. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  10179. * Returns
  10180. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  10181. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  10182. #### GetButtonSenseAxis/2
  10183. > `public override float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  10184. * Parameters
  10185. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  10186. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  10187. * Returns
  10188. * `float` - The current sense axis value.
  10189. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  10190. #### GetButtonHairlineDelta/2
  10191. > `public override float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  10192. * Parameters
  10193. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  10194. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  10195. * Returns
  10196. * `float` - The delta between the button presses.
  10197. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  10198. #### GetControllerButtonState/3
  10199. > `public override bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference)`
  10200. * Parameters
  10201. * `ButtonTypes buttonType` - The type of button to check for the state of.
  10202. * `ButtonPressTypes pressType` - The button state to check for.
  10203. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  10204. * Returns
  10205. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  10206. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  10207. ---
  10208. ## Daydream Boundaries (SDK_DaydreamBoundaries)
  10209. ### Overview
  10210. The Daydream Boundaries SDK script provides dummy functions for the play area boundaries.
  10211. ### Class Methods
  10212. #### InitBoundaries/0
  10213. > `public override void InitBoundaries()`
  10214. * Parameters
  10215. * _none_
  10216. * Returns
  10217. * _none_
  10218. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  10219. #### GetPlayArea/0
  10220. > `public override Transform GetPlayArea()`
  10221. * Parameters
  10222. * _none_
  10223. * Returns
  10224. * `Transform` - A transform of the object representing the play area in the scene.
  10225. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  10226. #### GetPlayAreaVertices/0
  10227. > `public override Vector3[] GetPlayAreaVertices()`
  10228. * Parameters
  10229. * _none_
  10230. * Returns
  10231. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  10232. The GetPlayAreaVertices method returns the points of the play area boundaries.
  10233. #### GetPlayAreaBorderThickness/0
  10234. > `public override float GetPlayAreaBorderThickness()`
  10235. * Parameters
  10236. * _none_
  10237. * Returns
  10238. * `float` - The thickness of the drawn border.
  10239. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  10240. #### IsPlayAreaSizeCalibrated/0
  10241. > `public override bool IsPlayAreaSizeCalibrated()`
  10242. * Parameters
  10243. * _none_
  10244. * Returns
  10245. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  10246. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  10247. #### GetDrawAtRuntime/0
  10248. > `public override bool GetDrawAtRuntime()`
  10249. * Parameters
  10250. * _none_
  10251. * Returns
  10252. * `bool` - Returns true if the drawn border is being displayed.
  10253. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  10254. #### SetDrawAtRuntime/1
  10255. > `public override void SetDrawAtRuntime(bool value)`
  10256. * Parameters
  10257. * `bool value` - The state of whether the drawn border should be displayed or not.
  10258. * Returns
  10259. * _none_
  10260. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  10261. ---
  10262. # Ximmerse SDK (VRTK/Source/SDK/Ximmerse)
  10263. The scripts used to utilise the Ximmerse SDK for Unity.
  10264. * [Ximmerse Defines](#ximmerse-defines-sdk_ximmersedefines)
  10265. * [Ximmerse System](#ximmerse-system-sdk_ximmersesystem)
  10266. * [Ximmerse Headset](#ximmerse-headset-sdk_ximmerseheadset)
  10267. * [Ximmerse Controller](#ximmerse-controller-sdk_ximmersecontroller)
  10268. * [Ximmerse Boundaries](#ximmerse-boundaries-sdk_ximmerseboundaries)
  10269. ---
  10270. ## Ximmerse Defines (SDK_XimmerseDefines)
  10271. ### Overview
  10272. Handles all the scripting define symbols for the Ximmerse SDK.
  10273. ### Class Variables
  10274. * `public const string ScriptingDefineSymbol` - The scripting define symbol for the Ximmerse SDK. Default: `SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "SDK_XIMMERSE"`
  10275. ---
  10276. ## Ximmerse System (SDK_XimmerseSystem)
  10277. ### Overview
  10278. The Ximmerse System SDK script provides a bridge to the Ximmerse SDK.
  10279. ### Class Methods
  10280. #### IsDisplayOnDesktop/0
  10281. > `public override bool IsDisplayOnDesktop()`
  10282. * Parameters
  10283. * _none_
  10284. * Returns
  10285. * `bool` - Returns true if the display is extending the desktop
  10286. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  10287. #### ShouldAppRenderWithLowResources/0
  10288. > `public override bool ShouldAppRenderWithLowResources()`
  10289. * Parameters
  10290. * _none_
  10291. * Returns
  10292. * `bool` - Returns true if the Unity app should render with low resources.
  10293. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  10294. #### ForceInterleavedReprojectionOn/1
  10295. > `public override void ForceInterleavedReprojectionOn(bool force)`
  10296. * Parameters
  10297. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  10298. * Returns
  10299. * _none_
  10300. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  10301. ---
  10302. ## Ximmerse Headset (SDK_XimmerseHeadset)
  10303. ### Overview
  10304. The Ximmerse Headset SDK script provides a bridge to the Ximmerse SDK.
  10305. ### Class Methods
  10306. #### ProcessUpdate/1
  10307. > `public override void ProcessUpdate(Dictionary<string, object> options)`
  10308. * Parameters
  10309. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  10310. * Returns
  10311. * _none_
  10312. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  10313. #### ProcessFixedUpdate/1
  10314. > `public override void ProcessFixedUpdate(Dictionary<string, object> options)`
  10315. * Parameters
  10316. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  10317. * Returns
  10318. * _none_
  10319. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  10320. #### GetHeadsetType/0
  10321. > `public override string GetHeadsetType()`
  10322. * Parameters
  10323. * _none_
  10324. * Returns
  10325. * `string` - The string of the headset connected.
  10326. The GetHeadsetType method returns a string representing the type of headset connected.
  10327. #### GetHeadsetVelocity/0
  10328. > `public override Vector3 GetHeadsetVelocity()`
  10329. * Parameters
  10330. * _none_
  10331. * Returns
  10332. * `Vector3` - A Vector3 containing the current velocity of the headset.
  10333. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  10334. #### GetHeadsetAngularVelocity/0
  10335. > `public override Vector3 GetHeadsetAngularVelocity()`
  10336. * Parameters
  10337. * _none_
  10338. * Returns
  10339. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  10340. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  10341. #### GetHeadset/0
  10342. > `public override Transform GetHeadset()`
  10343. * Parameters
  10344. * _none_
  10345. * Returns
  10346. * `Transform` - A transform of the object representing the headset in the scene.
  10347. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  10348. #### GetHeadsetCamera/0
  10349. > `public override Transform GetHeadsetCamera()`
  10350. * Parameters
  10351. * _none_
  10352. * Returns
  10353. * `Transform` - A transform of the object holding the headset camera in the scene.
  10354. The GetHeadsetCamera method returns the Transform of the object that is used to hold the headset camera in the scene.
  10355. #### HeadsetFade/3
  10356. > `public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)`
  10357. * Parameters
  10358. * `Color color` - The colour to fade to.
  10359. * `float duration` - The amount of time the fade should take to reach the given colour.
  10360. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  10361. * Returns
  10362. * _none_
  10363. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  10364. #### HasHeadsetFade/1
  10365. > `public override bool HasHeadsetFade(Transform obj)`
  10366. * Parameters
  10367. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  10368. * Returns
  10369. * `bool` - Returns true if the headset has fade functionality on it.
  10370. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  10371. #### AddHeadsetFade/1
  10372. > `public override void AddHeadsetFade(Transform camera)`
  10373. * Parameters
  10374. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  10375. * Returns
  10376. * _none_
  10377. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  10378. ---
  10379. ## Ximmerse Controller (SDK_XimmerseController)
  10380. ### Overview
  10381. The Ximmerse Controller SDK script provides a bridge to SDK methods that deal with the input devices.
  10382. ### Class Methods
  10383. #### ProcessUpdate/2
  10384. > `public override void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  10385. * Parameters
  10386. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  10387. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  10388. * Returns
  10389. * _none_
  10390. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  10391. #### ProcessFixedUpdate/2
  10392. > `public override void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  10393. * Parameters
  10394. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  10395. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  10396. * Returns
  10397. * _none_
  10398. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  10399. #### GetCurrentControllerType/1
  10400. > `public override ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  10401. * Parameters
  10402. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  10403. * Returns
  10404. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  10405. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  10406. #### GetControllerDefaultColliderPath/1
  10407. > `public override string GetControllerDefaultColliderPath(ControllerHand hand)`
  10408. * Parameters
  10409. * `ControllerHand hand` - The controller hand to check for
  10410. * Returns
  10411. * `string` - A path to the resource that contains the collider GameObject.
  10412. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  10413. #### GetControllerElementPath/3
  10414. > `public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)`
  10415. * Parameters
  10416. * `ControllerElements element` - The controller element to look up.
  10417. * `ControllerHand hand` - The controller hand to look up.
  10418. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  10419. * Returns
  10420. * `string` - A string containing the path to the game object that the controller element resides in.
  10421. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  10422. #### GetControllerIndex/1
  10423. > `public override uint GetControllerIndex(GameObject controller)`
  10424. * Parameters
  10425. * `GameObject controller` - The GameObject containing the controller.
  10426. * Returns
  10427. * `uint` - The index of the given controller.
  10428. The GetControllerIndex method returns the index of the given controller.
  10429. #### GetControllerByIndex/2
  10430. > `public override GameObject GetControllerByIndex(uint index, bool actual = false)`
  10431. * Parameters
  10432. * `uint index` - The index of the controller to find.
  10433. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  10434. * Returns
  10435. * `GameObject` -
  10436. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  10437. #### GetControllerOrigin/1
  10438. > `public override Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  10439. * Parameters
  10440. * `VRTK_ControllerReference controllerReference` - The reference to the controller to retrieve the origin from.
  10441. * Returns
  10442. * `Transform` - A Transform containing the origin of the controller.
  10443. The GetControllerOrigin method returns the origin of the given controller.
  10444. #### GetControllerLeftHand/1
  10445. > `public override GameObject GetControllerLeftHand(bool actual = false)`
  10446. * Parameters
  10447. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  10448. * Returns
  10449. * `GameObject` - The GameObject containing the left hand controller.
  10450. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  10451. #### GetControllerRightHand/1
  10452. > `public override GameObject GetControllerRightHand(bool actual = false)`
  10453. * Parameters
  10454. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  10455. * Returns
  10456. * `GameObject` - The GameObject containing the right hand controller.
  10457. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  10458. #### IsControllerLeftHand/1
  10459. > `public override bool IsControllerLeftHand(GameObject controller)`
  10460. * Parameters
  10461. * `GameObject controller` - The GameObject to check.
  10462. * Returns
  10463. * `bool` - Returns true if the given controller is the left hand controller.
  10464. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  10465. #### IsControllerRightHand/1
  10466. > `public override bool IsControllerRightHand(GameObject controller)`
  10467. * Parameters
  10468. * `GameObject controller` - The GameObject to check.
  10469. * Returns
  10470. * `bool` - Returns true if the given controller is the right hand controller.
  10471. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  10472. #### IsControllerLeftHand/2
  10473. > `public override bool IsControllerLeftHand(GameObject controller, bool actual)`
  10474. * Parameters
  10475. * `GameObject controller` - The GameObject to check.
  10476. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  10477. * Returns
  10478. * `bool` - Returns true if the given controller is the left hand controller.
  10479. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  10480. #### IsControllerRightHand/2
  10481. > `public override bool IsControllerRightHand(GameObject controller, bool actual)`
  10482. * Parameters
  10483. * `GameObject controller` - The GameObject to check.
  10484. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  10485. * Returns
  10486. * `bool` - Returns true if the given controller is the right hand controller.
  10487. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  10488. #### WaitForControllerModel/1
  10489. > `public override bool WaitForControllerModel(ControllerHand hand)`
  10490. * Parameters
  10491. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  10492. * Returns
  10493. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  10494. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  10495. #### GetControllerModel/1
  10496. > `public override GameObject GetControllerModel(GameObject controller)`
  10497. * Parameters
  10498. * `GameObject controller` - The GameObject to get the model alias for.
  10499. * Returns
  10500. * `GameObject` - The GameObject that has the model alias within it.
  10501. The GetControllerModel method returns the model alias for the given GameObject.
  10502. #### GetControllerModel/1
  10503. > `public override GameObject GetControllerModel(ControllerHand hand)`
  10504. * Parameters
  10505. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  10506. * Returns
  10507. * `GameObject` - The GameObject that has the model alias within it.
  10508. The GetControllerModel method returns the model alias for the given controller hand.
  10509. #### GetControllerRenderModel/1
  10510. > `public override GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference)`
  10511. * Parameters
  10512. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check.
  10513. * Returns
  10514. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  10515. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  10516. #### SetControllerRenderModelWheel/2
  10517. > `public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)`
  10518. * Parameters
  10519. * `GameObject renderModel` - The GameObject containing the controller render model.
  10520. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  10521. * Returns
  10522. * _none_
  10523. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  10524. #### HapticPulse/2
  10525. > `public override void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5f)`
  10526. * Parameters
  10527. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  10528. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  10529. * Returns
  10530. * _none_
  10531. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  10532. #### HapticPulse/2
  10533. > `public override bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip)`
  10534. * Parameters
  10535. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  10536. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  10537. * Returns
  10538. * _none_
  10539. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  10540. #### GetHapticModifiers/0
  10541. > `public override SDK_ControllerHapticModifiers GetHapticModifiers()`
  10542. * Parameters
  10543. * _none_
  10544. * Returns
  10545. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  10546. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  10547. #### GetVelocity/1
  10548. > `public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference)`
  10549. * Parameters
  10550. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  10551. * Returns
  10552. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  10553. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  10554. #### GetAngularVelocity/1
  10555. > `public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)`
  10556. * Parameters
  10557. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  10558. * Returns
  10559. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  10560. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  10561. #### IsTouchpadStatic/4
  10562. > `public override bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity)`
  10563. * Parameters
  10564. * `Vector2 currentAxisValues` -
  10565. * `Vector2 previousAxisValues` -
  10566. * `int compareFidelity` -
  10567. * Returns
  10568. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  10569. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  10570. #### GetButtonAxis/2
  10571. > `public override Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  10572. * Parameters
  10573. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  10574. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  10575. * Returns
  10576. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  10577. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  10578. #### GetButtonSenseAxis/2
  10579. > `public override float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  10580. * Parameters
  10581. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  10582. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  10583. * Returns
  10584. * `float` - The current sense axis value.
  10585. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  10586. #### GetButtonHairlineDelta/2
  10587. > `public override float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  10588. * Parameters
  10589. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  10590. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  10591. * Returns
  10592. * `float` - The delta between the button presses.
  10593. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  10594. #### GetControllerButtonState/3
  10595. > `public override bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference)`
  10596. * Parameters
  10597. * `ButtonTypes buttonType` - The type of button to check for the state of.
  10598. * `ButtonPressTypes pressType` - The button state to check for.
  10599. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  10600. * Returns
  10601. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  10602. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  10603. ---
  10604. ## Ximmerse Boundaries (SDK_XimmerseBoundaries)
  10605. ### Overview
  10606. The Ximmerse Boundaries SDK script provides a bridge to the Ximmerse SDK play area.
  10607. ### Class Methods
  10608. #### InitBoundaries/0
  10609. > `public override void InitBoundaries()`
  10610. * Parameters
  10611. * _none_
  10612. * Returns
  10613. * _none_
  10614. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  10615. #### GetPlayArea/0
  10616. > `public override Transform GetPlayArea()`
  10617. * Parameters
  10618. * _none_
  10619. * Returns
  10620. * `Transform` - A transform of the object representing the play area in the scene.
  10621. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  10622. #### GetPlayAreaVertices/0
  10623. > `public override Vector3[] GetPlayAreaVertices()`
  10624. * Parameters
  10625. * _none_
  10626. * Returns
  10627. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  10628. The GetPlayAreaVertices method returns the points of the play area boundaries.
  10629. #### GetPlayAreaBorderThickness/0
  10630. > `public override float GetPlayAreaBorderThickness()`
  10631. * Parameters
  10632. * _none_
  10633. * Returns
  10634. * `float` - The thickness of the drawn border.
  10635. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  10636. #### IsPlayAreaSizeCalibrated/0
  10637. > `public override bool IsPlayAreaSizeCalibrated()`
  10638. * Parameters
  10639. * _none_
  10640. * Returns
  10641. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  10642. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  10643. #### GetDrawAtRuntime/0
  10644. > `public override bool GetDrawAtRuntime()`
  10645. * Parameters
  10646. * _none_
  10647. * Returns
  10648. * `bool` - Returns true if the drawn border is being displayed.
  10649. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  10650. #### SetDrawAtRuntime/1
  10651. > `public override void SetDrawAtRuntime(bool value)`
  10652. * Parameters
  10653. * `bool value` - The state of whether the drawn border should be displayed or not.
  10654. * Returns
  10655. * _none_
  10656. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  10657. ---
  10658. # HyperealVR SDK (VRTK/Source/SDK/HyperealVR)
  10659. The scripts used to utilise the HyperealVR SDK for Unity.
  10660. * [HyperealVR Defines](#hyperealvr-defines-sdk_hyperealvrdefines)
  10661. * [HyperealVR System](#hyperealvr-system-sdk_hyperealvrsystem)
  10662. * [HyperealVR Headset](#hyperealvr-headset-sdk_hyperealvrheadset)
  10663. * [HyperealVR Controller](#hyperealvr-controller-sdk_hyperealvrcontroller)
  10664. * [HyperealVR Boundaries](#hyperealvr-boundaries-sdk_hyperealvrboundaries)
  10665. ---
  10666. ## HyperealVR Defines (SDK_HyperealVRDefines)
  10667. ### Overview
  10668. Handles all the scripting define symbols for the Hypereal SDK.
  10669. ### Class Variables
  10670. * `public const string ScriptingDefineSymbol` - The scripting define symbol for the Hypereal SDK. Default: `SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix +`
  10671. ---
  10672. ## HyperealVR System (SDK_HyperealVRSystem)
  10673. ### Overview
  10674. The HyperealVR System SDK script provides a bridge to the HyperealVR SDK.
  10675. ### Class Methods
  10676. #### IsDisplayOnDesktop/0
  10677. > `public override bool IsDisplayOnDesktop()`
  10678. * Parameters
  10679. * _none_
  10680. * Returns
  10681. * `bool` - Returns true if the display is extending the desktop
  10682. The IsDisplayOnDesktop method returns true if the display is extending the desktop.
  10683. #### ShouldAppRenderWithLowResources/0
  10684. > `public override bool ShouldAppRenderWithLowResources()`
  10685. * Parameters
  10686. * _none_
  10687. * Returns
  10688. * `bool` - Returns true if the Unity app should render with low resources.
  10689. The ShouldAppRenderWithLowResources method is used to determine if the Unity app should use low resource mode. Typically true when the dashboard is showing.
  10690. #### ForceInterleavedReprojectionOn/1
  10691. > `public override void ForceInterleavedReprojectionOn(bool force)`
  10692. * Parameters
  10693. * `bool force` - If true then Interleaved Reprojection will be forced on, if false it will not be forced on.
  10694. * Returns
  10695. * _none_
  10696. The ForceInterleavedReprojectionOn method determines whether Interleaved Reprojection should be forced on or off.
  10697. ---
  10698. ## HyperealVR Headset (SDK_HyperealVRHeadset)
  10699. ### Overview
  10700. The HyperealVR Headset SDK script provides a bridge to the HyperealVR SDK.
  10701. ### Class Methods
  10702. #### ProcessUpdate/1
  10703. > `public override void ProcessUpdate(Dictionary<string, object> options)`
  10704. * Parameters
  10705. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  10706. * Returns
  10707. * _none_
  10708. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  10709. #### ProcessFixedUpdate/1
  10710. > `public override void ProcessFixedUpdate(Dictionary<string, object> options)`
  10711. * Parameters
  10712. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  10713. * Returns
  10714. * _none_
  10715. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  10716. #### GetHeadset/0
  10717. > `public override Transform GetHeadset()`
  10718. * Parameters
  10719. * _none_
  10720. * Returns
  10721. * `Transform` - A transform of the object representing the headset in the scene.
  10722. The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  10723. #### GetHeadsetCamera/0
  10724. > `public override Transform GetHeadsetCamera()`
  10725. * Parameters
  10726. * _none_
  10727. * Returns
  10728. * `Transform` - A transform of the object holding the headset camera in the scene.
  10729. The GetHeadsetCamera method returns the Transform of the object that is used to hold the headset camera in the scene.
  10730. #### GetHeadsetType/0
  10731. > `public override string GetHeadsetType()`
  10732. * Parameters
  10733. * _none_
  10734. * Returns
  10735. * `string` - The string of the headset connected.
  10736. The GetHeadsetType method returns a string representing the type of headset connected.
  10737. #### GetHeadsetVelocity/0
  10738. > `public override Vector3 GetHeadsetVelocity()`
  10739. * Parameters
  10740. * _none_
  10741. * Returns
  10742. * `Vector3` - A Vector3 containing the current velocity of the headset.
  10743. The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  10744. #### GetHeadsetAngularVelocity/0
  10745. > `public override Vector3 GetHeadsetAngularVelocity()`
  10746. * Parameters
  10747. * _none_
  10748. * Returns
  10749. * `Vector3` - A Vector3 containing the current angular velocity of the headset.
  10750. The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  10751. #### HeadsetFade/3
  10752. > `public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)`
  10753. * Parameters
  10754. * `Color color` - The colour to fade to.
  10755. * `float duration` - The amount of time the fade should take to reach the given colour.
  10756. * `bool fadeOverlay` - Determines whether to use an overlay on the fade.
  10757. * Returns
  10758. * _none_
  10759. The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  10760. #### HasHeadsetFade/1
  10761. > `public override bool HasHeadsetFade(Transform obj)`
  10762. * Parameters
  10763. * `Transform obj` - The Transform to check to see if a camera fade is available on.
  10764. * Returns
  10765. * `bool` - Returns true if the headset has fade functionality on it.
  10766. The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  10767. #### AddHeadsetFade/1
  10768. > `public override void AddHeadsetFade(Transform camera)`
  10769. * Parameters
  10770. * `Transform camera` - The Transform to with the camera on to add the fade functionality to.
  10771. * Returns
  10772. * _none_
  10773. The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  10774. ---
  10775. ## HyperealVR Controller (SDK_HyperealVRController)
  10776. ### Overview
  10777. The HyperealVR Controller SDK script provides a bridge to SDK methods that deal with the input devices.
  10778. ### Class Methods
  10779. #### ProcessUpdate/2
  10780. > `public override void ProcessUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  10781. * Parameters
  10782. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  10783. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the update.
  10784. * Returns
  10785. * _none_
  10786. The ProcessUpdate method enables an SDK to run logic for every Unity Update
  10787. #### ProcessFixedUpdate/2
  10788. > `public override void ProcessFixedUpdate(VRTK_ControllerReference controllerReference, Dictionary<string, object> options)`
  10789. * Parameters
  10790. * `VRTK_ControllerReference controllerReference` - The reference for the controller.
  10791. * `Dictionary<string, object> options` - A dictionary of generic options that can be used to within the fixed update.
  10792. * Returns
  10793. * _none_
  10794. The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  10795. #### GetCurrentControllerType/1
  10796. > `public override ControllerType GetCurrentControllerType(VRTK_ControllerReference controllerReference = null)`
  10797. * Parameters
  10798. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get type of.
  10799. * Returns
  10800. * `ControllerType` - The ControllerType based on the SDK and headset being used.
  10801. The GetCurrentControllerType method returns the current used ControllerType based on the SDK and headset being used.
  10802. #### GetControllerDefaultColliderPath/1
  10803. > `public override string GetControllerDefaultColliderPath(ControllerHand hand)`
  10804. * Parameters
  10805. * `ControllerHand hand` - The controller hand to check for
  10806. * Returns
  10807. * `string` - A path to the resource that contains the collider GameObject.
  10808. The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
  10809. #### GetControllerElementPath/3
  10810. > `public override string GetControllerElementPath(ControllerElements element, ControllerHand hand, bool fullPath = false)`
  10811. * Parameters
  10812. * `ControllerElements element` - The controller element to look up.
  10813. * `ControllerHand hand` - The controller hand to look up.
  10814. * `bool fullPath` - Whether to get the initial path or the full path to the element.
  10815. * Returns
  10816. * `string` - A string containing the path to the game object that the controller element resides in.
  10817. The GetControllerElementPath returns the path to the game object that the given controller element for the given hand resides in.
  10818. #### GetControllerIndex/1
  10819. > `public override uint GetControllerIndex(GameObject controller)`
  10820. * Parameters
  10821. * `GameObject controller` - The GameObject containing the controller.
  10822. * Returns
  10823. * `uint` - The index of the given controller.
  10824. The GetControllerIndex method returns the index of the given controller.
  10825. #### GetControllerByIndex/2
  10826. > `public override GameObject GetControllerByIndex(uint index, bool actual = false)`
  10827. * Parameters
  10828. * `uint index` - The index of the controller to find.
  10829. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  10830. * Returns
  10831. * `GameObject` - The GameObject of the controller
  10832. The GetControllerByIndex method returns the GameObject of a controller with a specific index.
  10833. #### GetControllerOrigin/1
  10834. > `public override Transform GetControllerOrigin(VRTK_ControllerReference controllerReference)`
  10835. * Parameters
  10836. * `VRTK_ControllerReference controllerReference` - The controller to retrieve the origin from.
  10837. * Returns
  10838. * `Transform` - A Transform containing the origin of the controller.
  10839. The GetControllerOrigin method returns the origin of the given controller.
  10840. #### GetControllerLeftHand/1
  10841. > `public override GameObject GetControllerLeftHand(bool actual = false)`
  10842. * Parameters
  10843. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  10844. * Returns
  10845. * `GameObject` - The GameObject containing the left hand controller.
  10846. The GetControllerLeftHand method returns the GameObject containing the representation of the left hand controller.
  10847. #### GetControllerRightHand/1
  10848. > `public override GameObject GetControllerRightHand(bool actual = false)`
  10849. * Parameters
  10850. * `bool actual` - If true it will return the actual controller, if false it will return the script alias controller GameObject.
  10851. * Returns
  10852. * `GameObject` - The GameObject containing the right hand controller.
  10853. The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
  10854. #### IsControllerLeftHand/1
  10855. > `public override bool IsControllerLeftHand(GameObject controller)`
  10856. * Parameters
  10857. * `GameObject controller` - The GameObject to check.
  10858. * Returns
  10859. * `bool` - Returns true if the given controller is the left hand controller.
  10860. The IsControllerLeftHand/1 method is used to check if the given controller is the the left hand controller.
  10861. #### IsControllerRightHand/1
  10862. > `public override bool IsControllerRightHand(GameObject controller)`
  10863. * Parameters
  10864. * `GameObject controller` - The GameObject to check.
  10865. * Returns
  10866. * `bool` - Returns true if the given controller is the right hand controller.
  10867. The IsControllerRightHand/1 method is used to check if the given controller is the the right hand controller.
  10868. #### IsControllerLeftHand/2
  10869. > `public override bool IsControllerLeftHand(GameObject controller, bool actual)`
  10870. * Parameters
  10871. * `GameObject controller` - The GameObject to check.
  10872. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  10873. * Returns
  10874. * `bool` - Returns true if the given controller is the left hand controller.
  10875. The IsControllerLeftHand/2 method is used to check if the given controller is the the left hand controller.
  10876. #### IsControllerRightHand/2
  10877. > `public override bool IsControllerRightHand(GameObject controller, bool actual)`
  10878. * Parameters
  10879. * `GameObject controller` - The GameObject to check.
  10880. * `bool actual` - If true it will check the actual controller, if false it will check the script alias controller.
  10881. * Returns
  10882. * `bool` - Returns true if the given controller is the right hand controller.
  10883. The IsControllerRightHand/2 method is used to check if the given controller is the the right hand controller.
  10884. #### WaitForControllerModel/1
  10885. > `public override bool WaitForControllerModel(ControllerHand hand)`
  10886. * Parameters
  10887. * `ControllerHand hand` - The hand to determine if the controller model will be ready for.
  10888. * Returns
  10889. * `bool` - Returns true if the controller model requires loading in at runtime and therefore needs waiting for. Returns false if the controller model will be available at start.
  10890. The WaitForControllerModel method determines whether the controller model for the given hand requires waiting to load in on scene start.
  10891. #### GetControllerModel/1
  10892. > `public override GameObject GetControllerModel(GameObject controller)`
  10893. * Parameters
  10894. * `GameObject controller` - The GameObject to get the model alias for.
  10895. * Returns
  10896. * `GameObject` - The GameObject that has the model alias within it.
  10897. The GetControllerModel method returns the model alias for the given GameObject.
  10898. #### GetControllerModel/1
  10899. > `public override GameObject GetControllerModel(ControllerHand hand)`
  10900. * Parameters
  10901. * `ControllerHand hand` - The hand enum of which controller model to retrieve.
  10902. * Returns
  10903. * `GameObject` - The GameObject that has the model alias within it.
  10904. The GetControllerModel method returns the model alias for the given controller hand.
  10905. #### GetControllerRenderModel/1
  10906. > `public override GameObject GetControllerRenderModel(VRTK_ControllerReference controllerReference)`
  10907. * Parameters
  10908. * `VRTK_ControllerReference controllerReference` - The GameObject to check.
  10909. * Returns
  10910. * `GameObject` - A GameObject containing the object that has a render model for the controller.
  10911. The GetControllerRenderModel method gets the game object that contains the given controller's render model.
  10912. #### SetControllerRenderModelWheel/2
  10913. > `public override void SetControllerRenderModelWheel(GameObject renderModel, bool state)`
  10914. * Parameters
  10915. * `GameObject renderModel` - The GameObject containing the controller render model.
  10916. * `bool state` - If true and the render model has a scroll wheen then it will be displayed, if false then the scroll wheel will be hidden.
  10917. * Returns
  10918. * _none_
  10919. The SetControllerRenderModelWheel method sets the state of the scroll wheel on the controller render model.
  10920. #### HapticPulse/2
  10921. > `public override void HapticPulse(VRTK_ControllerReference controllerReference, float strength = 0.5f)`
  10922. * Parameters
  10923. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  10924. * `float strength` - The intensity of the rumble of the controller motor. `0` to `1`.
  10925. * Returns
  10926. * _none_
  10927. The HapticPulse/2 method is used to initiate a simple haptic pulse on the tracked object of the given controller reference.
  10928. #### HapticPulse/2
  10929. > `public override bool HapticPulse(VRTK_ControllerReference controllerReference, AudioClip clip)`
  10930. * Parameters
  10931. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to initiate the haptic pulse on.
  10932. * `AudioClip clip` - The audio clip to use for the haptic pattern.
  10933. * Returns
  10934. * _none_
  10935. The HapticPulse/2 method is used to initiate a haptic pulse based on an audio clip on the tracked object of the given controller reference.
  10936. #### GetHapticModifiers/0
  10937. > `public override SDK_ControllerHapticModifiers GetHapticModifiers()`
  10938. * Parameters
  10939. * _none_
  10940. * Returns
  10941. * `SDK_ControllerHapticModifiers` - An SDK_ControllerHapticModifiers object with a given `durationModifier` and an `intervalModifier`.
  10942. The GetHapticModifiers method is used to return modifiers for the duration and interval if the SDK handles it slightly differently.
  10943. #### GetVelocity/1
  10944. > `public override Vector3 GetVelocity(VRTK_ControllerReference controllerReference)`
  10945. * Parameters
  10946. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  10947. * Returns
  10948. * `Vector3` - A Vector3 containing the current velocity of the tracked object.
  10949. The GetVelocity method is used to determine the current velocity of the tracked object on the given controller reference.
  10950. #### GetAngularVelocity/1
  10951. > `public override Vector3 GetAngularVelocity(VRTK_ControllerReference controllerReference)`
  10952. * Parameters
  10953. * `VRTK_ControllerReference controllerReference` - The reference to the tracked object to check for.
  10954. * Returns
  10955. * `Vector3` - A Vector3 containing the current angular velocity of the tracked object.
  10956. The GetAngularVelocity method is used to determine the current angular velocity of the tracked object on the given controller reference.
  10957. #### IsTouchpadStatic/4
  10958. > `public override bool IsTouchpadStatic(bool isTouched, Vector2 currentAxisValues, Vector2 previousAxisValues, int compareFidelity)`
  10959. * Parameters
  10960. * `Vector2 currentAxisValues` -
  10961. * `Vector2 previousAxisValues` -
  10962. * `int compareFidelity` -
  10963. * Returns
  10964. * `bool` - Returns true if the touchpad is not currently being touched or moved.
  10965. The IsTouchpadStatic method is used to determine if the touchpad is currently not being moved.
  10966. #### GetButtonAxis/2
  10967. > `public override Vector2 GetButtonAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  10968. * Parameters
  10969. * `ButtonTypes buttonType` - The type of button to check for the axis on.
  10970. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button axis on.
  10971. * Returns
  10972. * `Vector2` - A Vector2 of the X/Y values of the button axis. If no axis values exist for the given button, then a Vector2.Zero is returned.
  10973. The GetButtonAxis method retrieves the current X/Y axis values for the given button type on the given controller reference.
  10974. #### GetButtonSenseAxis/2
  10975. > `public override float GetButtonSenseAxis(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  10976. * Parameters
  10977. * `ButtonTypes buttonType` - The type of button to check for the sense axis on.
  10978. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the sense axis on.
  10979. * Returns
  10980. * `float` - The current sense axis value.
  10981. The GetButtonSenseAxis method retrieves the current sense axis value for the given button type on the given controller reference.
  10982. #### GetButtonHairlineDelta/2
  10983. > `public override float GetButtonHairlineDelta(ButtonTypes buttonType, VRTK_ControllerReference controllerReference)`
  10984. * Parameters
  10985. * `ButtonTypes buttonType` - The type of button to get the hairline delta for.
  10986. * `VRTK_ControllerReference controllerReference` - The reference to the controller to get the hairline delta for.
  10987. * Returns
  10988. * `float` - The delta between the button presses.
  10989. The GetButtonHairlineDelta method is used to get the difference between the current button press and the previous frame button press.
  10990. #### GetControllerButtonState/3
  10991. > `public override bool GetControllerButtonState(ButtonTypes buttonType, ButtonPressTypes pressType, VRTK_ControllerReference controllerReference)`
  10992. * Parameters
  10993. * `ButtonTypes buttonType` - The type of button to check for the state of.
  10994. * `ButtonPressTypes pressType` - The button state to check for.
  10995. * `VRTK_ControllerReference controllerReference` - The reference to the controller to check the button state on.
  10996. * Returns
  10997. * `bool` - Returns true if the given button is in the state of the given press type on the given controller reference.
  10998. The GetControllerButtonState method is used to determine if the given controller button for the given press type on the given controller reference is currently taking place.
  10999. ---
  11000. ## HyperealVR Boundaries (SDK_HyperealVRBoundaries)
  11001. ### Overview
  11002. The HyperealVR Boundaries SDK script provides a bridge to the HyperealVR SDK play area.
  11003. ### Class Methods
  11004. #### InitBoundaries/0
  11005. > `public override void InitBoundaries()`
  11006. * Parameters
  11007. * _none_
  11008. * Returns
  11009. * _none_
  11010. The InitBoundaries method is run on start of scene and can be used to initialse anything on game start.
  11011. #### GetPlayArea/0
  11012. > `public override Transform GetPlayArea()`
  11013. * Parameters
  11014. * _none_
  11015. * Returns
  11016. * `Transform` - A transform of the object representing the play area in the scene.
  11017. The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
  11018. #### GetPlayAreaVertices/0
  11019. > `public override Vector3[] GetPlayAreaVertices()`
  11020. * Parameters
  11021. * _none_
  11022. * Returns
  11023. * `Vector3[]` - A Vector3 array of the points in the scene that represent the play area boundaries.
  11024. The GetPlayAreaVertices method returns the points of the play area boundaries.
  11025. #### GetPlayAreaBorderThickness/0
  11026. > `public override float GetPlayAreaBorderThickness()`
  11027. * Parameters
  11028. * _none_
  11029. * Returns
  11030. * `float` - The thickness of the drawn border.
  11031. The GetPlayAreaBorderThickness returns the thickness of the drawn border for the given play area.
  11032. #### IsPlayAreaSizeCalibrated/0
  11033. > `public override bool IsPlayAreaSizeCalibrated()`
  11034. * Parameters
  11035. * _none_
  11036. * Returns
  11037. * `bool` - Returns true if the play area size has been auto calibrated and set by external sensors.
  11038. The IsPlayAreaSizeCalibrated method returns whether the given play area size has been auto calibrated by external sensors.
  11039. #### GetDrawAtRuntime/0
  11040. > `public override bool GetDrawAtRuntime()`
  11041. * Parameters
  11042. * _none_
  11043. * Returns
  11044. * `bool` - Returns true if the drawn border is being displayed.
  11045. The GetDrawAtRuntime method returns whether the given play area drawn border is being displayed.
  11046. #### SetDrawAtRuntime/1
  11047. > `public override void SetDrawAtRuntime(bool value)`
  11048. * Parameters
  11049. * `bool value` - The state of whether the drawn border should be displayed or not.
  11050. * Returns
  11051. * _none_
  11052. The SetDrawAtRuntime method sets whether the given play area drawn border should be displayed at runtime.
  11053. ---