{"_id":"5b1f8576c2505d0003125454","category":{"_id":"5b1f8576c2505d0003125430","version":"5b1f8576c2505d00031254db","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T17:04:07.774Z","from_sync":false,"order":13,"slug":"3d-controls","title":"Controllables"},"project":"571fa55ca0acd42000af9545","user":"571fa519db52d01700f5cf3d","parentDoc":null,"version":{"_id":"5b1f8576c2505d00031254db","project":"571fa55ca0acd42000af9545","__v":4,"forked_from":"594949e52be16d0026ec04cd","createdAt":"2017-06-20T16:14:29.816Z","releaseDate":"2017-06-20T16:14:29.816Z","categories":["5b1f8576c2505d0003125424","5b1f8576c2505d0003125425","5b1f8576c2505d0003125426","5b1f8576c2505d0003125427","5b1f8576c2505d0003125428","5b1f8576c2505d0003125429","5b1f8576c2505d000312542a","5b1f8576c2505d000312542b","5b1f8576c2505d000312542c","5b1f8576c2505d000312542d","5b1f8576c2505d000312542e","5b1f8576c2505d000312542f","5b1f8576c2505d0003125430","5b1f8576c2505d0003125431","5b1f8576c2505d0003125432","5b1f8576c2505d0003125433","5b1f8576c2505d0003125434","5b1f8576c2505d0003125435","5b1f8576c2505d0003125436","5b1f8576c2505d0003125437","5b1f8576c2505d0003125438","5b1f8aab9c683000032979e7","5b1f8b2f3073470003ffa5da","5b1f8bd9fd653400031d94f4","5b1f900bd4c5f000036b57bd"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Mangalica","version_clean":"3.3.0","version":"3.3.0"},"githubsync":"","__v":1,"updates":["5cd206407c83ed0063471084"],"next":{"pages":[],"description":""},"createdAt":"2017-01-01T17:06:45.368Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":8,"body":"> extends [VRTK_BaseControllable](doc:vrtk_basecontrollable)\n\n## Overview\n\nA artificially simulated slider.\n\n**Required Components:**\n * `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.\n\n**Script Usage:**\n * Create a slider container GameObject and set the GameObject that is to become the slider as a child of the container.\n * Place the `VRTK_ArtificialSlider` script onto the GameObject that is to become the slider.\n\n  > 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.\n\n## Inspector Parameters\n\n * **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.\n * **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.\n * **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).\n * **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.\n * **Step Value Range:** The minimum and the maximum step values for the slider to register along the `Operate Axis`.\n * **Step Size:** The increments the slider value will change in between the `Step Value Range`.\n * **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.\n * **Snap To Step:** If this is checked then the slider will snap to the position of the nearest step along the value range.\n * **Snap Force:** The speed in which the slider will snap to the relevant point along the `Operate Axis`\n * **Tracking Speed:** The speed in which to track the grabbed slider to the interacting object.\n * **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.\n * **Detach Distance:** The maximum distance the grabbing object is away from the slider before it is automatically released.\n * **Release Friction:** The amount of friction to the slider Rigidbody when it is released.\n * **Only Interact With:** A collection of GameObjects that will be used as the valid collisions to determine if the door can be interacted with.\n\n## Class Methods\n\n### GetValue/0\n\n  > `public override float GetValue()`\n\n * Parameters\n   * _none_\n * Returns\n   * `float` - The actual position of the button.\n\nThe GetValue method returns the current position value of the slider.\n\n### GetNormalizedValue/0\n\n  > `public override float GetNormalizedValue()`\n\n * Parameters\n   * _none_\n * Returns\n   * `float` - The normalized position of the button.\n\nThe GetNormalizedValue method returns the current position value of the slider normalized between `0f` and `1f`.\n\n### SetValue/1\n\n  > `public override void SetValue(float value)`\n\n * Parameters\n   * `float value` - The new position value\n * Returns\n   * _none_\n\nThe SetValue method sets the current position value of the slider\n\n### GetStepValue/1\n\n  > `public virtual float GetStepValue(float currentValue)`\n\n * Parameters\n   * `float currentValue` - The current position value of the slider to get the Step Value for.\n * Returns\n   * `float` - The current Step Value based on the slider position.\n\nThe GetStepValue method returns the current position of the slider based on the step value range.\n\n### SetPositionTarget/2\n\n  > `public virtual void SetPositionTarget(float newPositionTarget, float speed)`\n\n * Parameters\n   * `float newPositionTarget` - The new position target value.\n   * `float speed` - The speed to move to the new position target.\n * Returns\n   * _none_\n\nThe SetPositionTarget method allows the setting of the `Position Target` parameter at runtime.\n\n### SetPositionTargetWithStepValue/2\n\n  > `public virtual void SetPositionTargetWithStepValue(float givenStepValue, float speed)`\n\n * Parameters\n   * `float givenStepValue` - The step value within the `Step Value Range` to set the `Position Target` parameter to.\n   * `float speed` - The speed to move to the new position target.\n * Returns\n   * _none_\n\nThe SetPositionTargetWithStepValue sets the `Position Target` parameter but uses a value within the `Step Value Range`.\n\n### SetRestingPositionWithStepValue/1\n\n  > `public virtual void SetRestingPositionWithStepValue(float givenStepValue)`\n\n * Parameters\n   * `float givenStepValue` - The step value within the `Step Value Range` to set the `Resting Position` parameter to.\n * Returns\n   * _none_\n\nThe SetRestingPositionWithStepValue sets the `Resting Position` parameter but uses a value within the `Step Value Range`.\n\n### GetPositionFromStepValue/1\n\n  > `public virtual float GetPositionFromStepValue(float givenStepValue)`\n\n * Parameters\n   * `float givenStepValue` - The step value to check the position for.\n * Returns\n   * `float` - The position the slider would be at based on the given step value.\n\nThe GetPositionFromStepValue returns the position the slider would be at based on the given step value.\n\n### IsResting/0\n\n  > `public override bool IsResting()`\n\n * Parameters\n   * _none_\n * Returns\n   * `bool` - Returns `true` if the slider is at the resting position or within the resting position threshold.\n\nThe IsResting method returns whether the slider is at the resting position or within the resting position threshold.\n\n### GetControlInteractableObject/0\n\n  > `public virtual VRTK_InteractableObject GetControlInteractableObject()`\n\n * Parameters\n   * _none_\n * Returns\n   * `VRTK_InteractableObject` - The Interactable Object associated with the control.\n\nThe GetControlInteractableObject method returns the Interactable Object associated with the control.","excerpt":"","slug":"vrtk_lever","type":"basic","title":"VRTK_ArtificialSlider"}

VRTK_ArtificialSlider


> extends [VRTK_BaseControllable](doc:vrtk_basecontrollable) ## Overview A artificially simulated slider. **Required Components:** * `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. **Script Usage:** * Create a slider container GameObject and set the GameObject that is to become the slider as a child of the container. * Place the `VRTK_ArtificialSlider` script onto the GameObject that is to become the slider. > 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. ## Inspector Parameters * **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. * **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. * **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). * **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. * **Step Value Range:** The minimum and the maximum step values for the slider to register along the `Operate Axis`. * **Step Size:** The increments the slider value will change in between the `Step Value Range`. * **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. * **Snap To Step:** If this is checked then the slider will snap to the position of the nearest step along the value range. * **Snap Force:** The speed in which the slider will snap to the relevant point along the `Operate Axis` * **Tracking Speed:** The speed in which to track the grabbed slider to the interacting object. * **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. * **Detach Distance:** The maximum distance the grabbing object is away from the slider before it is automatically released. * **Release Friction:** The amount of friction to the slider Rigidbody when it is released. * **Only Interact With:** A collection of GameObjects that will be used as the valid collisions to determine if the door can be interacted with. ## Class Methods ### GetValue/0 > `public override float GetValue()` * Parameters * _none_ * Returns * `float` - The actual position of the button. The GetValue method returns the current position value of the slider. ### GetNormalizedValue/0 > `public override float GetNormalizedValue()` * Parameters * _none_ * Returns * `float` - The normalized position of the button. The GetNormalizedValue method returns the current position value of the slider normalized between `0f` and `1f`. ### SetValue/1 > `public override void SetValue(float value)` * Parameters * `float value` - The new position value * Returns * _none_ The SetValue method sets the current position value of the slider ### GetStepValue/1 > `public virtual float GetStepValue(float currentValue)` * Parameters * `float currentValue` - The current position value of the slider to get the Step Value for. * Returns * `float` - The current Step Value based on the slider position. The GetStepValue method returns the current position of the slider based on the step value range. ### SetPositionTarget/2 > `public virtual void SetPositionTarget(float newPositionTarget, float speed)` * Parameters * `float newPositionTarget` - The new position target value. * `float speed` - The speed to move to the new position target. * Returns * _none_ The SetPositionTarget method allows the setting of the `Position Target` parameter at runtime. ### SetPositionTargetWithStepValue/2 > `public virtual void SetPositionTargetWithStepValue(float givenStepValue, float speed)` * Parameters * `float givenStepValue` - The step value within the `Step Value Range` to set the `Position Target` parameter to. * `float speed` - The speed to move to the new position target. * Returns * _none_ The SetPositionTargetWithStepValue sets the `Position Target` parameter but uses a value within the `Step Value Range`. ### SetRestingPositionWithStepValue/1 > `public virtual void SetRestingPositionWithStepValue(float givenStepValue)` * Parameters * `float givenStepValue` - The step value within the `Step Value Range` to set the `Resting Position` parameter to. * Returns * _none_ The SetRestingPositionWithStepValue sets the `Resting Position` parameter but uses a value within the `Step Value Range`. ### GetPositionFromStepValue/1 > `public virtual float GetPositionFromStepValue(float givenStepValue)` * Parameters * `float givenStepValue` - The step value to check the position for. * Returns * `float` - The position the slider would be at based on the given step value. The GetPositionFromStepValue returns the position the slider would be at based on the given step value. ### IsResting/0 > `public override bool IsResting()` * Parameters * _none_ * Returns * `bool` - Returns `true` if the slider is at the resting position or within the resting position threshold. The IsResting method returns whether the slider is at the resting position or within the resting position threshold. ### GetControlInteractableObject/0 > `public virtual VRTK_InteractableObject GetControlInteractableObject()` * Parameters * _none_ * Returns * `VRTK_InteractableObject` - The Interactable Object associated with the control. The GetControlInteractableObject method returns the Interactable Object associated with the control.