{"_id":"5b1f8576c2505d0003125453","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"},"user":"571fa519db52d01700f5cf3d","parentDoc":null,"project":"571fa55ca0acd42000af9545","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":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-02-25T10:40:51.843Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"> extends [VRTK_BaseControllable](doc:vrtk_basecontrollable)\n\n## Overview\n\nA artificially simulated openable rotator.\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 rotator container GameObject and set the GameObject that is to become the rotator as a child of the newly created container GameObject.\n * Place the `VRTK_ArtificialRotator` script onto the GameObject that is to become the rotatable object and ensure the Transform rotation is `0, 0, 0`.\n * Create a nested GameObject under the rotator GameObject and position it where the hinge should operate.\n * Apply the nested hinge GameObject to the `Hinge Point` parameter on the Artificial Rotator script.\n\n  > 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.\n  > The Artificial Rotator script GameObject will become the child of a runtime created GameObject that determines the rotational offset for the rotator.\n\n## Inspector Parameters\n\n * **Hinge Point:** A Transform that denotes the position where the rotator will rotate around.\n * **Angle Limits:** The minimum and maximum angle the rotator can rotate to.\n * **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.\n * **Resting Angle:** The angle at which will be considered as the resting position of the rotator.\n * **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`.\n * **Is Locked:** If this is checked then the rotator Rigidbody will have all rotations frozen.\n * **Step Value Range:** The minimum and the maximum step values for the rotator to register along the `Operate Axis`.\n * **Step Size:** The increments the rotator value will change in between the `Step Value Range`.\n * **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.\n * **Snap To Step:** If this is checked then the rotator will snap to the angle of the nearest step along the value range.\n * **Snap Force:** The speed in which the rotator will snap to the relevant angle along the `Operate Axis`\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 rotator before it is automatically released.\n * **Rotation Action:** Determines how the rotation of the object is calculated based on the action of the grabbing object.\n * **Grabbed Friction:** The simulated friction when the rotator is grabbed.\n * **Released Friction:** The simulated friction when the rotator is released.\n * **Only Interact With:** A collection of GameObjects that will be used as the valid collisions to determine if the rotator 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 rotation of the rotator.\n\nThe GetValue method returns the current rotation value of the rotator.\n\n### GetNormalizedValue/0\n\n  > `public override float GetNormalizedValue()`\n\n * Parameters\n   * _none_\n * Returns\n   * `float` - The normalized rotation of the rotator.\n\nThe GetNormalizedValue method returns the current rotation value of the rotator 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 rotation value\n * Returns\n   * _none_\n\nThe SetValue method sets the current Angle of the rotator\n\n### GetContainer/0\n\n  > `public virtual GameObject GetContainer()`\n\n * Parameters\n   * _none_\n * Returns\n   * `GameObject` - The GameObject container of the rotator control.\n\nThe GetContainer method returns the GameObject that is generated to hold the rotator control.\n\n### GetStepValue/1\n\n  > `public virtual float GetStepValue(float currentValue)`\n\n * Parameters\n   * `float currentValue` - The current angle value of the rotator to get the Step Value for.\n * Returns\n   * `float` - The current Step Value based on the rotator angle.\n\nThe GetStepValue method returns the current angle of the rotator based on the step value range.\n\n### SetAngleTargetWithStepValue/1\n\n  > `public virtual void SetAngleTargetWithStepValue(float givenStepValue)`\n\n * Parameters\n   * `float givenStepValue` - The step value within the `Step Value Range` to set the `Angle Target` parameter to.\n * Returns\n   * _none_\n\nThe SetAngleTargetWithStepValue sets the `Angle Target` parameter but uses a value within the `Step Value Range`.\n\n### SetRestingAngleWithStepValue/1\n\n  > `public virtual void SetRestingAngleWithStepValue(float givenStepValue)`\n\n * Parameters\n   * `float givenStepValue` - The step value within the `Step Value Range` to set the `Resting Angle` parameter to.\n * Returns\n   * _none_\n\nThe SetRestingAngleWithStepValue sets the `Resting Angle` parameter but uses a value within the `Step Value Range`.\n\n### GetAngleFromStepValue/1\n\n  > `public virtual float GetAngleFromStepValue(float givenStepValue)`\n\n * Parameters\n   * `float givenStepValue` - The step value to check the angle for.\n * Returns\n   * `float` - The angle the rotator would be at based on the given step value.\n\nThe GetAngleFromStepValue returns the angle the rotator would be at based on the given step value.\n\n### SetAngleTarget/1\n\n  > `public virtual void SetAngleTarget(float newAngle)`\n\n * Parameters\n   * `float newAngle` - The angle in which to rotate the rotator to.\n * Returns\n   * _none_\n\nThe SetAngleTarget method sets a target angle to rotate the rotator to.\n\n### IsResting/0\n\n  > `public override bool IsResting()`\n\n * Parameters\n   * _none_\n * Returns\n   * `bool` - Returns `true` if the rotator is at the resting angle or within the resting angle threshold.\n\nThe IsResting method returns whether the rotator is at the resting angle or within the resting angle 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_wheel","type":"basic","title":"VRTK_ArtificialRotator"}

VRTK_ArtificialRotator


> extends [VRTK_BaseControllable](doc:vrtk_basecontrollable) ## Overview A artificially simulated openable rotator. **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 rotator container GameObject and set the GameObject that is to become the rotator as a child of the newly created container GameObject. * Place the `VRTK_ArtificialRotator` script onto the GameObject that is to become the rotatable object and ensure the Transform rotation is `0, 0, 0`. * Create a nested GameObject under the rotator GameObject and position it where the hinge should operate. * Apply the nested hinge GameObject to the `Hinge Point` parameter on the Artificial Rotator script. > 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. > The Artificial Rotator script GameObject will become the child of a runtime created GameObject that determines the rotational offset for the rotator. ## Inspector Parameters * **Hinge Point:** A Transform that denotes the position where the rotator will rotate around. * **Angle Limits:** The minimum and maximum angle the rotator can rotate to. * **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. * **Resting Angle:** The angle at which will be considered as the resting position of the rotator. * **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`. * **Is Locked:** If this is checked then the rotator Rigidbody will have all rotations frozen. * **Step Value Range:** The minimum and the maximum step values for the rotator to register along the `Operate Axis`. * **Step Size:** The increments the rotator value will change in between the `Step Value Range`. * **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. * **Snap To Step:** If this is checked then the rotator will snap to the angle of the nearest step along the value range. * **Snap Force:** The speed in which the rotator will snap to the relevant angle along the `Operate Axis` * **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 rotator before it is automatically released. * **Rotation Action:** Determines how the rotation of the object is calculated based on the action of the grabbing object. * **Grabbed Friction:** The simulated friction when the rotator is grabbed. * **Released Friction:** The simulated friction when the rotator is released. * **Only Interact With:** A collection of GameObjects that will be used as the valid collisions to determine if the rotator can be interacted with. ## Class Methods ### GetValue/0 > `public override float GetValue()` * Parameters * _none_ * Returns * `float` - The actual rotation of the rotator. The GetValue method returns the current rotation value of the rotator. ### GetNormalizedValue/0 > `public override float GetNormalizedValue()` * Parameters * _none_ * Returns * `float` - The normalized rotation of the rotator. The GetNormalizedValue method returns the current rotation value of the rotator normalized between `0f` and `1f`. ### SetValue/1 > `public override void SetValue(float value)` * Parameters * `float value` - The new rotation value * Returns * _none_ The SetValue method sets the current Angle of the rotator ### GetContainer/0 > `public virtual GameObject GetContainer()` * Parameters * _none_ * Returns * `GameObject` - The GameObject container of the rotator control. The GetContainer method returns the GameObject that is generated to hold the rotator control. ### GetStepValue/1 > `public virtual float GetStepValue(float currentValue)` * Parameters * `float currentValue` - The current angle value of the rotator to get the Step Value for. * Returns * `float` - The current Step Value based on the rotator angle. The GetStepValue method returns the current angle of the rotator based on the step value range. ### SetAngleTargetWithStepValue/1 > `public virtual void SetAngleTargetWithStepValue(float givenStepValue)` * Parameters * `float givenStepValue` - The step value within the `Step Value Range` to set the `Angle Target` parameter to. * Returns * _none_ The SetAngleTargetWithStepValue sets the `Angle Target` parameter but uses a value within the `Step Value Range`. ### SetRestingAngleWithStepValue/1 > `public virtual void SetRestingAngleWithStepValue(float givenStepValue)` * Parameters * `float givenStepValue` - The step value within the `Step Value Range` to set the `Resting Angle` parameter to. * Returns * _none_ The SetRestingAngleWithStepValue sets the `Resting Angle` parameter but uses a value within the `Step Value Range`. ### GetAngleFromStepValue/1 > `public virtual float GetAngleFromStepValue(float givenStepValue)` * Parameters * `float givenStepValue` - The step value to check the angle for. * Returns * `float` - The angle the rotator would be at based on the given step value. The GetAngleFromStepValue returns the angle the rotator would be at based on the given step value. ### SetAngleTarget/1 > `public virtual void SetAngleTarget(float newAngle)` * Parameters * `float newAngle` - The angle in which to rotate the rotator to. * Returns * _none_ The SetAngleTarget method sets a target angle to rotate the rotator to. ### IsResting/0 > `public override bool IsResting()` * Parameters * _none_ * Returns * `bool` - Returns `true` if the rotator is at the resting angle or within the resting angle threshold. The IsResting method returns whether the rotator is at the resting angle or within the resting angle 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.