{"__v":0,"_id":"58b157a425d13f23007437b3","category":{"version":"58796781cd4a9c37007c96ef","project":"571fa55ca0acd42000af9545","_id":"58796781cd4a9c37007c96f2","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:38:26.097Z","from_sync":false,"order":2,"slug":"pointers","title":"Pointers"},"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-02-25T10:08:36.685Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"> extends [VRTK_DestinationMarker](doc:vrtk_destinationmarker)\n\n## Overview\n\nThe VRTK Pointer class forms the basis of being able to emit a pointer from a game object (e.g. controller).\n\nThe concept of the pointer is it can be activated and deactivated and used to select elements utilising different button combinations if required.\n\nThe Pointer requires a Pointer Renderer which is the visualisation of the pointer in the scene.\n\nA Pointer can also be used to extend the interactions of an interacting object such as a controller. This enables pointers to touch (and highlight), grab and use interactable objects.\n\nThe Pointer script does not need to go on a controller game object, but if it's placed on another object then a controller must be provided to determine what activates the pointer.\n\nIt extends the `VRTK_DestinationMarker` to allow for destination events to be emitted when the pointer cursor collides with objects.\n\n## Inspector Parameters\n\n * **Pointer Renderer:** The specific renderer to use when the pointer is activated. The renderer also determines how the pointer reaches it's destination (e.g. straight line, bezier curve).\n * **Activation Button:** The button used to activate/deactivate the pointer.\n * **Hold Button To Activate:** If this is checked then the Activation Button needs to be continuously held down to keep the pointer active. If this is unchecked then the Activation Button works as a toggle, the first press/release enables the pointer and the second press/release disables the pointer.\n * **Activation Delay:** The time in seconds to delay the pointer being able to be active again.\n * **Selection Button:** The button used to execute the select action at the pointer's target position.\n * **Select On Press:** If this is checked then the pointer selection action is executed when the Selection Button is pressed down. If this is unchecked then the selection action is executed when the Selection Button is released.\n * **Interact With Objects:** If this is checked then the pointer will be an extension of the controller and able to interact with Interactable Objects.\n * **Grab To Pointer Tip:** If `Interact With Objects` is checked and this is checked then when an object is grabbed with the pointer touching it, the object will attach to the pointer tip and not snap to the controller.\n * **Controller:** The controller that will be used to toggle the pointer. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.\n * **Custom Origin:** A custom transform to use as the origin of the pointer. If no pointer origin transform is provided then the transform the script is attached to is used.\n\n## Class Methods\n\n### PointerEnter/1\n\n  > `public virtual void PointerEnter(RaycastHit givenHit)`\n\n  * Parameters\n   * `RaycastHit givenHit` - The valid collision.\n  * Returns\n   * _none_\n\nThe PointerEnter method emits a DestinationMarkerEnter event when the pointer enters a valid object.\n\n### PointerExit/1\n\n  > `public virtual void PointerExit(RaycastHit givenHit)`\n\n  * Parameters\n   * `RaycastHit givenHit` - The previous valid collision.\n  * Returns\n   * _none_\n\nThe PointerExit method emits a DestinationMarkerExit event when the pointer leaves a previously entered object.\n\n### CanActivate/0\n\n  > `public virtual bool CanActivate()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `bool` - Returns true if the pointer can be activated.\n\nThe CanActivate method is used to determine if the pointer has passed the activation time limit.\n\n### IsPointerActive/0\n\n  > `public virtual bool IsPointerActive()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `bool` - Returns true if the pointer is currently active.\n\nThe IsPointerActive method is used to determine if the pointer's current state is active or not.\n\n### ResetActivationTimer/1\n\n  > `public virtual void ResetActivationTimer(bool forceZero = false)`\n\n  * Parameters\n   * `bool forceZero` - If this is true then the next activation time will be 0.\n  * Returns\n   * _none_\n\nThe ResetActivationTimer method is used to reset the pointer activation timer to the next valid activation time.\n\n### Toggle/1\n\n  > `public virtual void Toggle(bool state)`\n\n  * Parameters\n   * `bool state` - If true the pointer will be enabled if possible, if false the pointer will be disabled if possible.\n  * Returns\n   * _none_\n\nThe Toggle method is used to enable or disable the pointer.","excerpt":"","slug":"vrtk_pointer","type":"basic","title":"VRTK_Pointer"}
> extends [VRTK_DestinationMarker](doc:vrtk_destinationmarker) ## Overview The VRTK Pointer class forms the basis of being able to emit a pointer from a game object (e.g. controller). The concept of the pointer is it can be activated and deactivated and used to select elements utilising different button combinations if required. The Pointer requires a Pointer Renderer which is the visualisation of the pointer in the scene. A Pointer can also be used to extend the interactions of an interacting object such as a controller. This enables pointers to touch (and highlight), grab and use interactable objects. The Pointer script does not need to go on a controller game object, but if it's placed on another object then a controller must be provided to determine what activates the pointer. It extends the `VRTK_DestinationMarker` to allow for destination events to be emitted when the pointer cursor collides with objects. ## Inspector Parameters * **Pointer Renderer:** The specific renderer to use when the pointer is activated. The renderer also determines how the pointer reaches it's destination (e.g. straight line, bezier curve). * **Activation Button:** The button used to activate/deactivate the pointer. * **Hold Button To Activate:** If this is checked then the Activation Button needs to be continuously held down to keep the pointer active. If this is unchecked then the Activation Button works as a toggle, the first press/release enables the pointer and the second press/release disables the pointer. * **Activation Delay:** The time in seconds to delay the pointer being able to be active again. * **Selection Button:** The button used to execute the select action at the pointer's target position. * **Select On Press:** If this is checked then the pointer selection action is executed when the Selection Button is pressed down. If this is unchecked then the selection action is executed when the Selection Button is released. * **Interact With Objects:** If this is checked then the pointer will be an extension of the controller and able to interact with Interactable Objects. * **Grab To Pointer Tip:** If `Interact With Objects` is checked and this is checked then when an object is grabbed with the pointer touching it, the object will attach to the pointer tip and not snap to the controller. * **Controller:** The controller that will be used to toggle the pointer. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime. * **Custom Origin:** A custom transform to use as the origin of the pointer. If no pointer origin transform is provided then the transform the script is attached to is used. ## Class Methods ### PointerEnter/1 > `public virtual void PointerEnter(RaycastHit givenHit)` * Parameters * `RaycastHit givenHit` - The valid collision. * Returns * _none_ The PointerEnter method emits a DestinationMarkerEnter event when the pointer enters a valid object. ### PointerExit/1 > `public virtual void PointerExit(RaycastHit givenHit)` * Parameters * `RaycastHit givenHit` - The previous valid collision. * Returns * _none_ The PointerExit method emits a DestinationMarkerExit event when the pointer leaves a previously entered object. ### CanActivate/0 > `public virtual bool CanActivate()` * Parameters * _none_ * Returns * `bool` - Returns true if the pointer can be activated. The CanActivate method is used to determine if the pointer has passed the activation time limit. ### IsPointerActive/0 > `public virtual bool IsPointerActive()` * Parameters * _none_ * Returns * `bool` - Returns true if the pointer is currently active. The IsPointerActive method is used to determine if the pointer's current state is active or not. ### ResetActivationTimer/1 > `public virtual void ResetActivationTimer(bool forceZero = false)` * Parameters * `bool forceZero` - If this is true then the next activation time will be 0. * Returns * _none_ The ResetActivationTimer method is used to reset the pointer activation timer to the next valid activation time. ### Toggle/1 > `public virtual void Toggle(bool state)` * Parameters * `bool state` - If true the pointer will be enabled if possible, if false the pointer will be disabled if possible. * Returns * _none_ The Toggle method is used to enable or disable the pointer.