{"_id":"594949e62be16d0026ec04f6","category":{"_id":"594949e62be16d0026ec04da","version":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T17:04:07.774Z","from_sync":false,"order":12,"slug":"3d-controls","title":"3D Controls"},"parentDoc":null,"project":"571fa55ca0acd42000af9545","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-01T17:04:41.684Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"## Overview\n\nAll 3D controls extend the `VRTK_Control` abstract class which provides a default set of methods and events that all of the subsequent controls expose.\n\n## Inspector Parameters\n\n * **Interact Without Grab:** If active the control will react to the controller without the need to push the grab button.\n\n## Class Variables\n\n * `public ValueChangedEvent OnValueChanged` - Emitted when the control is interacted with.\n * `public enum Direction` - 3D Control Directions\n  * `autodetect` - Attempt to auto detect the axis\n  * `x` - X axis\n  * `y` - Y axis\n  * `z` - Z axis\n\n## Class Events\n\n * `ValueChanged` - Emitted when the 3D Control value has changed.\n\n## Unity Events\n\nAdding the `VRTK_Control_UnityEvents` component to `VRTK_Control` 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 * `float value` - The current value being reported by the control.\n * `float normalizedValue` - The normalized value being reported by the control.\n\n## Class Methods\n\n### GetValue/0\n\n  > `public virtual float GetValue()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `float` - The current value of the control.\n\nThe GetValue method returns the current value/position/setting of the control depending on the control that is extending this abstract class.\n\n### GetNormalizedValue/0\n\n  > `public virtual float GetNormalizedValue()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `float` - The current normalized value of the control.\n\nThe GetNormalizedValue method returns the current value mapped onto a range between 0 and 100.\n\n### SetContent/2\n\n  > `public virtual void SetContent(GameObject content, bool hideContent)`\n\n  * Parameters\n   * `GameObject content` - The content to be considered within the control.\n   * `bool hideContent` - When true the content will be hidden in addition to being non-interactable in case the control is fully closed.\n  * Returns\n   * _none_\n\nThe SetContent method sets the given game object as the content of the control. This will then disable and optionally hide the content when a control is obscuring its view to prevent interacting with content within a control.\n\n### GetContent/0\n\n  > `public virtual GameObject GetContent()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `GameObject` - The currently stored content for the control.\n\nThe GetContent method returns the current game object of the control's content.","excerpt":"","slug":"vrtk_control","type":"basic","title":"VRTK_Control"}
## Overview All 3D controls extend the `VRTK_Control` abstract class which provides a default set of methods and events that all of the subsequent controls expose. ## Inspector Parameters * **Interact Without Grab:** If active the control will react to the controller without the need to push the grab button. ## Class Variables * `public ValueChangedEvent OnValueChanged` - Emitted when the control is interacted with. * `public enum Direction` - 3D Control Directions * `autodetect` - Attempt to auto detect the axis * `x` - X axis * `y` - Y axis * `z` - Z axis ## Class Events * `ValueChanged` - Emitted when the 3D Control value has changed. ## Unity Events Adding the `VRTK_Control_UnityEvents` component to `VRTK_Control` 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 * `float value` - The current value being reported by the control. * `float normalizedValue` - The normalized value being reported by the control. ## Class Methods ### GetValue/0 > `public virtual float GetValue()` * Parameters * _none_ * Returns * `float` - The current value of the control. The GetValue method returns the current value/position/setting of the control depending on the control that is extending this abstract class. ### GetNormalizedValue/0 > `public virtual float GetNormalizedValue()` * Parameters * _none_ * Returns * `float` - The current normalized value of the control. The GetNormalizedValue method returns the current value mapped onto a range between 0 and 100. ### SetContent/2 > `public virtual void SetContent(GameObject content, bool hideContent)` * Parameters * `GameObject content` - The content to be considered within the control. * `bool hideContent` - When true the content will be hidden in addition to being non-interactable in case the control is fully closed. * Returns * _none_ The SetContent method sets the given game object as the content of the control. This will then disable and optionally hide the content when a control is obscuring its view to prevent interacting with content within a control. ### GetContent/0 > `public virtual GameObject GetContent()` * Parameters * _none_ * Returns * `GameObject` - The currently stored content for the control. The GetContent method returns the current game object of the control's content.