{"__v":0,"_id":"58796781cd4a9c37007c9724","category":{"version":"58796781cd4a9c37007c96ef","project":"571fa55ca0acd42000af9545","_id":"58796781cd4a9c37007c96f8","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:58:11.374Z","from_sync":false,"order":10,"slug":"presence","title":"Presence"},"parentDoc":null,"project":"571fa55ca0acd42000af9545","user":"571fa519db52d01700f5cf3d","version":{"__v":4,"_id":"58796781cd4a9c37007c96ef","project":"571fa55ca0acd42000af9545","createdAt":"2017-01-13T23:49:21.393Z","releaseDate":"2017-01-13T23:49:21.393Z","categories":["58796781cd4a9c37007c96f0","58796781cd4a9c37007c96f1","58796781cd4a9c37007c96f2","58796781cd4a9c37007c96f3","58796781cd4a9c37007c96f4","58796781cd4a9c37007c96f5","58796781cd4a9c37007c96f6","58796781cd4a9c37007c96f7","58796781cd4a9c37007c96f8","58796781cd4a9c37007c96f9","58796781cd4a9c37007c96fa","58796781cd4a9c37007c96fb","58796781cd4a9c37007c96fc","58796781cd4a9c37007c96fd","58796781cd4a9c37007c96fe","58796781cd4a9c37007c96ff","58796781cd4a9c37007c9700","58b157ca1756cf370022f90d","58b1596f5dae732f00adeca2","58b1605a5dae732f00adecb1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Mukota","version_clean":"3.1.0","version":"3.1.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\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 * `OnControllerObscured` - Emits the ControllerObscured class event.\n * `OnControllerUnobscured` - Emits the ControllerUnobscured class event.\n * `OnControllerGlanceEnter` - Emits the ControllerGlanceEnter class event.\n * `OnControllerGlanceExit` - Emits the ControllerGlanceExit class event.\n\n## Event Payload\n\n * `RaycastHit raycastHit` - The Raycast Hit struct of item that is obscuring the path to the controller.\n * `uint controllerIndex` - The index of 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 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 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 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 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. ## 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. * `OnControllerObscured` - Emits the ControllerObscured class event. * `OnControllerUnobscured` - Emits the ControllerUnobscured class event. * `OnControllerGlanceEnter` - Emits the ControllerGlanceEnter class event. * `OnControllerGlanceExit` - Emits the ControllerGlanceExit class event. ## Event Payload * `RaycastHit raycastHit` - The Raycast Hit struct of item that is obscuring the path to the controller. * `uint controllerIndex` - The index of the controller that is being or has been obscured or being or has been glanced. ## Class Methods ### LeftControllerObscured/0 > `public 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 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 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 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.