{"_id":"594949e62be16d0026ec04f1","category":{"_id":"594949e62be16d0026ec04d8","version":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:58:11.374Z","from_sync":false,"order":10,"slug":"presence","title":"Presence"},"project":"571fa55ca0acd42000af9545","parentDoc":null,"user":"571fa519db52d01700f5cf3d","version":{"_id":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":2,"createdAt":"2017-06-20T16:14:29.816Z","releaseDate":"2017-06-20T16:14:29.816Z","categories":["594949e62be16d0026ec04ce","594949e62be16d0026ec04cf","594949e62be16d0026ec04d0","594949e62be16d0026ec04d1","594949e62be16d0026ec04d2","594949e62be16d0026ec04d3","594949e62be16d0026ec04d4","594949e62be16d0026ec04d5","594949e62be16d0026ec04d6","594949e62be16d0026ec04d7","594949e62be16d0026ec04d8","594949e62be16d0026ec04d9","594949e62be16d0026ec04da","594949e62be16d0026ec04db","594949e62be16d0026ec04dc","594949e62be16d0026ec04dd","594949e62be16d0026ec04de","594949e62be16d0026ec04df","594949e62be16d0026ec04e0","594949e62be16d0026ec04e1","59497219f4a8980024dd0631"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Kunekune","version_clean":"3.2.0","version":"3.2.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-01T16:59:02.319Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"## Overview\n\nThe purpose of Headset Controller Aware is to allow the headset to know if something is blocking the path between the headset and controllers and to know if the headset is looking at a controller.\n\n## Inspector Parameters\n\n * **Track Left Controller:** If this is checked then the left controller will be checked if items obscure it's path from the headset.\n * **Track Right Controller:** If this is checked then the right controller will be checked if items obscure it's path from the headset.\n * **Controller Glance Radius:** The radius of the accepted distance from the controller origin point to determine if the controller is being looked at.\n * **Custom Right Controller Origin:** A custom transform to provide the world space position of the right controller.\n * **Custom Left Controller Origin:** A custom transform to provide the world space position of the left controller.\n * **Custom Raycast:** A custom raycaster to use when raycasting to find controllers.\n\n## Class Events\n\n * `ControllerObscured` - Emitted when the controller is obscured by another object.\n * `ControllerUnobscured` - Emitted when the controller is no longer obscured by an object.\n * `ControllerGlanceEnter` - Emitted when the controller is seen by the headset view.\n * `ControllerGlanceExit` - Emitted when the controller is no longer seen by the headset view.\n\n## Unity Events\n\nAdding the `VRTK_HeadsetControllerAware_UnityEvents` component to `VRTK_HeadsetControllerAware` object allows access to `UnityEvents` that will react identically to the Class Events.\n\n * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.\n\n## Event Payload\n\n * `RaycastHit raycastHit` - The Raycast Hit struct of item that is obscuring the path to the controller.\n * `VRTK_ControllerReference controllerReference` - The reference to the controller that is being or has been obscured or being or has been glanced.\n\n## Class Methods\n\n### LeftControllerObscured/0\n\n  > `public virtual bool LeftControllerObscured()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `bool` - Returns true if the path between the headset and the controller is obscured.\n\nThe LeftControllerObscured method returns the state of if the left controller is being obscured from the path of the headset.\n\n### RightControllerObscured/0\n\n  > `public virtual bool RightControllerObscured()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `bool` - Returns true if the path between the headset and the controller is obscured.\n\nThe RightControllerObscured method returns the state of if the right controller is being obscured from the path of the headset.\n\n### LeftControllerGlanced/0\n\n  > `public virtual bool LeftControllerGlanced()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `bool` - Returns true if the headset can currently see the controller within the given radius threshold.\n\nthe LeftControllerGlanced method returns the state of if the headset is currently looking at the left controller or not.\n\n### RightControllerGlanced/0\n\n  > `public virtual bool RightControllerGlanced()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `bool` - Returns true if the headset can currently see the controller within the given radius threshold.\n\nthe RightControllerGlanced method returns the state of if the headset is currently looking at the right controller or not.\n\n## Example\n\n`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.","excerpt":"","slug":"vrtk_headsetcontrolleraware","type":"basic","title":"VRTK_HeadsetControllerAware"}

VRTK_HeadsetControllerAware


## Overview The purpose of Headset Controller Aware is to allow the headset to know if something is blocking the path between the headset and controllers and to know if the headset is looking at a controller. ## Inspector Parameters * **Track Left Controller:** If this is checked then the left controller will be checked if items obscure it's path from the headset. * **Track Right Controller:** If this is checked then the right controller will be checked if items obscure it's path from the headset. * **Controller Glance Radius:** The radius of the accepted distance from the controller origin point to determine if the controller is being looked at. * **Custom Right Controller Origin:** A custom transform to provide the world space position of the right controller. * **Custom Left Controller Origin:** A custom transform to provide the world space position of the left controller. * **Custom Raycast:** A custom raycaster to use when raycasting to find controllers. ## Class Events * `ControllerObscured` - Emitted when the controller is obscured by another object. * `ControllerUnobscured` - Emitted when the controller is no longer obscured by an object. * `ControllerGlanceEnter` - Emitted when the controller is seen by the headset view. * `ControllerGlanceExit` - Emitted when the controller is no longer seen by the headset view. ## Unity Events Adding the `VRTK_HeadsetControllerAware_UnityEvents` component to `VRTK_HeadsetControllerAware` object allows access to `UnityEvents` that will react identically to the Class Events. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`. ## Event Payload * `RaycastHit raycastHit` - The Raycast Hit struct of item that is obscuring the path to the controller. * `VRTK_ControllerReference controllerReference` - The reference to the controller that is being or has been obscured or being or has been glanced. ## Class Methods ### LeftControllerObscured/0 > `public virtual bool LeftControllerObscured()` * Parameters * _none_ * Returns * `bool` - Returns true if the path between the headset and the controller is obscured. The LeftControllerObscured method returns the state of if the left controller is being obscured from the path of the headset. ### RightControllerObscured/0 > `public virtual bool RightControllerObscured()` * Parameters * _none_ * Returns * `bool` - Returns true if the path between the headset and the controller is obscured. The RightControllerObscured method returns the state of if the right controller is being obscured from the path of the headset. ### LeftControllerGlanced/0 > `public virtual bool LeftControllerGlanced()` * Parameters * _none_ * Returns * `bool` - Returns true if the headset can currently see the controller within the given radius threshold. the LeftControllerGlanced method returns the state of if the headset is currently looking at the left controller or not. ### RightControllerGlanced/0 > `public virtual bool RightControllerGlanced()` * Parameters * _none_ * Returns * `bool` - Returns true if the headset can currently see the controller within the given radius threshold. the RightControllerGlanced method returns the state of if the headset is currently looking at the right controller or not. ## Example `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.