{"_id":"5b1f8576c2505d000312544d","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"},"parentDoc":null,"project":"571fa55ca0acd42000af9545","user":"571fa519db52d01700f5cf3d","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-01-01T17:04:41.684Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"## Overview\n\nProvides a base that all Controllables can inherit from.\n\n**Script Usage:**\n  > This is an abstract class that is to be inherited to a concrete class that provides controllable functionality, therefore this script should not be directly used.\n\n## Inspector Parameters\n\n * **Operate Axis:** The local axis in which the Controllable will operate through.\n * **Ignore Collisions With:** A collection of GameObjects to ignore collision events with.\n * **Exclude Collider Check On:** A collection of GameObjects to exclude when determining if a default collider should be created.\n * **Equality Fidelity:** The amount of fidelity when comparing the position of the control with the previous position. Determines if it's equal above a certain decimal place threshold.\n\n## Class Variables\n\n * `public enum OperatingAxis` - The local axis that the Controllable will be operated through.\n   * `xAxis` - The local x axis.\n   * `yAxis` - The local y axis.\n   * `zAxis` - The local z axis.\n\n## Class Events\n\n * `ValueChanged` - Emitted when the Controllable value has changed.\n * `RestingPointReached` - Emitted when the Controllable value has reached the resting point.\n * `MinLimitReached` - Emitted when the Controllable value has reached the minimum limit.\n * `MinLimitExited` - Emitted when the Controllable value has exited the minimum limit.\n * `MaxLimitReached` - Emitted when the Controllable value has reached the maximum limit.\n * `MaxLimitExited` - Emitted when the Controllable value has exited the maximum limit.\n\n## Unity Events\n\nAdding the `VRTK_BaseControllable_UnityEvents` component to `VRTK_BaseControllable` 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 * `Collider interactingCollider` - The Collider that is initiating the interaction.\n * `VRTK_InteractTouch interactingTouchScript` - The optional Interact Touch script that is initiating the interaction.\n * `float value` - The current value being reported by the controllable.\n * `float normalizedValue` - The normalized value being reported by the controllable.\n\n## Class Methods\n\n### AtMinLimit/0\n\n  > `public virtual bool AtMinLimit()`\n\n * Parameters\n   * _none_\n * Returns\n   * `bool` - Returns `true` if the Controllable is at it's minimum limit.\n\nThe AtMinLimit method returns whether the Controllable is currently at it's minimum limit.\n\n### AtMaxLimit/0\n\n  > `public virtual bool AtMaxLimit()`\n\n * Parameters\n   * _none_\n * Returns\n   * `bool` - Returns `true` if the Controllable is at it's maximum limit.\n\nThe AtMaxLimit method returns whether the Controllable is currently at it's maximum limit.\n\n### GetOriginalLocalPosition/0\n\n  > `public virtual Vector3 GetOriginalLocalPosition()`\n\n * Parameters\n   * _none_\n * Returns\n   * `Vector3` - A Vector3 of the original local position.\n\nThe GetOriginalLocalPosition method returns the original local position of the control.\n\n### GetOriginalLocalRotation/0\n\n  > `public virtual Quaternion GetOriginalLocalRotation()`\n\n * Parameters\n   * _none_\n * Returns\n   * `Quaternion` - A quaternion of the original local rotation.\n\nThe GetOriginalLocalRotation method returns the original local rotation of the control.\n\n### GetControlColliders/0\n\n  > `public virtual Collider[] GetControlColliders()`\n\n * Parameters\n   * _none_\n * Returns\n   * `Collider[]` - The Colliders array associated with the control.\n\nThe GetControlColliders method returns the Colliders array associated with the control.\n\n### GetInteractingCollider/0\n\n  > `public virtual Collider GetInteractingCollider()`\n\n * Parameters\n   * _none_\n * Returns\n   * `Collider` - The Collider currently interacting with the control.\n\nThe GetInteractingCollider method returns the Collider of the GameObject currently interacting with the control.\n\n### GetInteractingTouch/0\n\n  > `public virtual VRTK_InteractTouch GetInteractingTouch()`\n\n * Parameters\n   * _none_\n * Returns\n   * `VRTK_InteractTouch` - The Interact Touch script currently interacting with the control.\n\nThe GetInteractingTouch method returns the Interact Touch script of the GameObject currently interacting with the control.","excerpt":"","slug":"vrtk_control","type":"basic","title":"VRTK_BaseControllable"}

VRTK_BaseControllable


## Overview Provides a base that all Controllables can inherit from. **Script Usage:** > This is an abstract class that is to be inherited to a concrete class that provides controllable functionality, therefore this script should not be directly used. ## Inspector Parameters * **Operate Axis:** The local axis in which the Controllable will operate through. * **Ignore Collisions With:** A collection of GameObjects to ignore collision events with. * **Exclude Collider Check On:** A collection of GameObjects to exclude when determining if a default collider should be created. * **Equality Fidelity:** The amount of fidelity when comparing the position of the control with the previous position. Determines if it's equal above a certain decimal place threshold. ## Class Variables * `public enum OperatingAxis` - The local axis that the Controllable will be operated through. * `xAxis` - The local x axis. * `yAxis` - The local y axis. * `zAxis` - The local z axis. ## Class Events * `ValueChanged` - Emitted when the Controllable value has changed. * `RestingPointReached` - Emitted when the Controllable value has reached the resting point. * `MinLimitReached` - Emitted when the Controllable value has reached the minimum limit. * `MinLimitExited` - Emitted when the Controllable value has exited the minimum limit. * `MaxLimitReached` - Emitted when the Controllable value has reached the maximum limit. * `MaxLimitExited` - Emitted when the Controllable value has exited the maximum limit. ## Unity Events Adding the `VRTK_BaseControllable_UnityEvents` component to `VRTK_BaseControllable` 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 * `Collider interactingCollider` - The Collider that is initiating the interaction. * `VRTK_InteractTouch interactingTouchScript` - The optional Interact Touch script that is initiating the interaction. * `float value` - The current value being reported by the controllable. * `float normalizedValue` - The normalized value being reported by the controllable. ## Class Methods ### AtMinLimit/0 > `public virtual bool AtMinLimit()` * Parameters * _none_ * Returns * `bool` - Returns `true` if the Controllable is at it's minimum limit. The AtMinLimit method returns whether the Controllable is currently at it's minimum limit. ### AtMaxLimit/0 > `public virtual bool AtMaxLimit()` * Parameters * _none_ * Returns * `bool` - Returns `true` if the Controllable is at it's maximum limit. The AtMaxLimit method returns whether the Controllable is currently at it's maximum limit. ### GetOriginalLocalPosition/0 > `public virtual Vector3 GetOriginalLocalPosition()` * Parameters * _none_ * Returns * `Vector3` - A Vector3 of the original local position. The GetOriginalLocalPosition method returns the original local position of the control. ### GetOriginalLocalRotation/0 > `public virtual Quaternion GetOriginalLocalRotation()` * Parameters * _none_ * Returns * `Quaternion` - A quaternion of the original local rotation. The GetOriginalLocalRotation method returns the original local rotation of the control. ### GetControlColliders/0 > `public virtual Collider[] GetControlColliders()` * Parameters * _none_ * Returns * `Collider[]` - The Colliders array associated with the control. The GetControlColliders method returns the Colliders array associated with the control. ### GetInteractingCollider/0 > `public virtual Collider GetInteractingCollider()` * Parameters * _none_ * Returns * `Collider` - The Collider currently interacting with the control. The GetInteractingCollider method returns the Collider of the GameObject currently interacting with the control. ### GetInteractingTouch/0 > `public virtual VRTK_InteractTouch GetInteractingTouch()` * Parameters * _none_ * Returns * `VRTK_InteractTouch` - The Interact Touch script currently interacting with the control. The GetInteractingTouch method returns the Interact Touch script of the GameObject currently interacting with the control.