{"__v":0,"_id":"58796782cd4a9c37007c9732","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-01-01T16:39:58.970Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"## Overview\n\nThe Play Area Cursor is used in conjunction with a Pointer script and displays a representation of the play area where the pointer cursor hits.\n\n## Inspector Parameters\n\n * **Play Area Cursor Dimensions:** Determines the size of the play area cursor and collider. If the values are left as zero then the Play Area Cursor will be sized to the calibrated Play Area space.\n * **Handle Play Area Cursor Collisions:** If this is ticked then if the play area cursor is colliding with any other object then the pointer colour will change to the `Pointer Miss Color` and the `DestinationMarkerSet` event will not be triggered, which will prevent teleporting into areas where the play area will collide.\n * **Headset Out Of Bounds Is Collision:** If this is ticked then if the user's headset is outside of the play area cursor bounds then it is considered a collision even if the play area isn't colliding with anything.\n * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether the play area cursor collisions will be acted upon.\n\n## Class Methods\n\n### HasCollided/0\n\n  > `public virtual bool HasCollided()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `bool` - A bool to determine the state of collision. `true` if the play area is colliding with a valid object and `false` if not.\n\nThe HasCollided method returns the state of whether the play area cursor has currently collided with another valid object.\n\n### SetHeadsetPositionCompensation/1\n\n  > `public virtual void SetHeadsetPositionCompensation(bool state)`\n\n  * Parameters\n   * `bool state` - The state of whether to take the position of the headset within the play area into account when setting the destination marker.\n  * Returns\n   * _none_\n\nThe SetHeadsetPositionCompensation method determines whether the offset position of the headset from the centre of the play area should be taken into consideration when setting the destination marker. If `true` then it will take the offset position into consideration.\n\n### SetPlayAreaCursorCollision/1\n\n  > `public virtual void SetPlayAreaCursorCollision(bool state)`\n\n  * Parameters\n   * `bool state` - The state of whether to check for play area collisions.\n  * Returns\n   * _none_\n\nThe SetPlayAreaCursorCollision method determines whether play area collisions should be taken into consideration with the play area cursor.\n\n### SetMaterialColor/1\n\n  > `public virtual void SetMaterialColor(Color color)`\n\n  * Parameters\n   * `Color color` - The colour to update the play area cursor material to.\n  * Returns\n   * _none_\n\nThe SetMaterialColor method sets the current material colour on the play area cursor.\n\n### SetPlayAreaCursorTransform/1\n\n  > `public virtual void SetPlayAreaCursorTransform(Vector3 location)`\n\n  * Parameters\n   * `Vector3 location` - The location where to draw the play area cursor.\n  * Returns\n   * _none_\n\nThe SetPlayAreaCursorTransform method is used to update the position of the play area cursor in world space to the given location.\n\n### ToggleState/1\n\n  > `public virtual void ToggleState(bool state)`\n\n  * Parameters\n   * `bool state` - The state of whether to show or hide the play area cursor.\n  * Returns\n   * _none_\n\nThe ToggleState method enables or disables the visibility of the play area cursor.\n\n### IsActive/0\n\n  > `public virtual bool IsActive()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `bool` - Returns true if the play area cursor GameObject is active.\n\nThe IsActive method returns whether the play area cursor game object is active or not.\n\n### GetPlayAreaContainer/0\n\n  > `public virtual GameObject GetPlayAreaContainer()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `GameObject` - The GameObject that is the container of the play area cursor.\n\nThe GetPlayAreaContainer method returns the created game object that holds the play area cursor representation.\n\n### ToggleVisibility/1\n\n  > `public virtual void ToggleVisibility(bool state)`\n\n  * Parameters\n   * `bool state` - The state of the cursor visibility. True will show the renderers and false will hide the renderers.\n  * Returns\n   * _none_\n\nThe ToggleVisibility method enables or disables the play area cursor renderers to allow the cursor to be seen or hidden.\n\n## Example\n\n`VRTK/Examples/012_Controller_PointerWithAreaCollision` shows how a Bezier Pointer with the Play Area Cursor and Collision Detection enabled can be used to traverse a game area but not allow teleporting into areas where the walls or other objects would fall into the play area space enabling the user to enter walls.","excerpt":"","slug":"vrtk_playareacursor","type":"basic","title":"VRTK_PlayAreaCursor"}

VRTK_PlayAreaCursor


## Overview The Play Area Cursor is used in conjunction with a Pointer script and displays a representation of the play area where the pointer cursor hits. ## Inspector Parameters * **Play Area Cursor Dimensions:** Determines the size of the play area cursor and collider. If the values are left as zero then the Play Area Cursor will be sized to the calibrated Play Area space. * **Handle Play Area Cursor Collisions:** If this is ticked then if the play area cursor is colliding with any other object then the pointer colour will change to the `Pointer Miss Color` and the `DestinationMarkerSet` event will not be triggered, which will prevent teleporting into areas where the play area will collide. * **Headset Out Of Bounds Is Collision:** If this is ticked then if the user's headset is outside of the play area cursor bounds then it is considered a collision even if the play area isn't colliding with anything. * **Target List Policy:** A specified VRTK_PolicyList to use to determine whether the play area cursor collisions will be acted upon. ## Class Methods ### HasCollided/0 > `public virtual bool HasCollided()` * Parameters * _none_ * Returns * `bool` - A bool to determine the state of collision. `true` if the play area is colliding with a valid object and `false` if not. The HasCollided method returns the state of whether the play area cursor has currently collided with another valid object. ### SetHeadsetPositionCompensation/1 > `public virtual void SetHeadsetPositionCompensation(bool state)` * Parameters * `bool state` - The state of whether to take the position of the headset within the play area into account when setting the destination marker. * Returns * _none_ The SetHeadsetPositionCompensation method determines whether the offset position of the headset from the centre of the play area should be taken into consideration when setting the destination marker. If `true` then it will take the offset position into consideration. ### SetPlayAreaCursorCollision/1 > `public virtual void SetPlayAreaCursorCollision(bool state)` * Parameters * `bool state` - The state of whether to check for play area collisions. * Returns * _none_ The SetPlayAreaCursorCollision method determines whether play area collisions should be taken into consideration with the play area cursor. ### SetMaterialColor/1 > `public virtual void SetMaterialColor(Color color)` * Parameters * `Color color` - The colour to update the play area cursor material to. * Returns * _none_ The SetMaterialColor method sets the current material colour on the play area cursor. ### SetPlayAreaCursorTransform/1 > `public virtual void SetPlayAreaCursorTransform(Vector3 location)` * Parameters * `Vector3 location` - The location where to draw the play area cursor. * Returns * _none_ The SetPlayAreaCursorTransform method is used to update the position of the play area cursor in world space to the given location. ### ToggleState/1 > `public virtual void ToggleState(bool state)` * Parameters * `bool state` - The state of whether to show or hide the play area cursor. * Returns * _none_ The ToggleState method enables or disables the visibility of the play area cursor. ### IsActive/0 > `public virtual bool IsActive()` * Parameters * _none_ * Returns * `bool` - Returns true if the play area cursor GameObject is active. The IsActive method returns whether the play area cursor game object is active or not. ### GetPlayAreaContainer/0 > `public virtual GameObject GetPlayAreaContainer()` * Parameters * _none_ * Returns * `GameObject` - The GameObject that is the container of the play area cursor. The GetPlayAreaContainer method returns the created game object that holds the play area cursor representation. ### ToggleVisibility/1 > `public virtual void ToggleVisibility(bool state)` * Parameters * `bool state` - The state of the cursor visibility. True will show the renderers and false will hide the renderers. * Returns * _none_ The ToggleVisibility method enables or disables the play area cursor renderers to allow the cursor to be seen or hidden. ## Example `VRTK/Examples/012_Controller_PointerWithAreaCollision` shows how a Bezier Pointer with the Play Area Cursor and Collision Detection enabled can be used to traverse a game area but not allow teleporting into areas where the walls or other objects would fall into the play area space enabling the user to enter walls.