{"_id":"594951bd64b5f5002690b812","project":"571fa55ca0acd42000af9545","version":{"_id":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":2,"createdAt":"2017-06-20T16:14:29.816Z","releaseDate":"2017-06-20T16:14:29.816Z","categories":["594949e62be16d0026ec04ce","594949e62be16d0026ec04cf","594949e62be16d0026ec04d0","594949e62be16d0026ec04d1","594949e62be16d0026ec04d2","594949e62be16d0026ec04d3","594949e62be16d0026ec04d4","594949e62be16d0026ec04d5","594949e62be16d0026ec04d6","594949e62be16d0026ec04d7","594949e62be16d0026ec04d8","594949e62be16d0026ec04d9","594949e62be16d0026ec04da","594949e62be16d0026ec04db","594949e62be16d0026ec04dc","594949e62be16d0026ec04dd","594949e62be16d0026ec04de","594949e62be16d0026ec04df","594949e62be16d0026ec04e0","594949e62be16d0026ec04e1","59497219f4a8980024dd0631"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Kunekune","version_clean":"3.2.0","version":"3.2.0"},"category":{"_id":"594949e62be16d0026ec04cf","version":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-31T16:56:01.612Z","from_sync":false,"order":1,"slug":"prefabs","title":"Prefabs"},"user":"571fa519db52d01700f5cf3d","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-20T16:47:57.406Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":11,"body":"## Overview\n\nThe Pointer Direction Indicator is used to determine a given world rotation that can be used by a Destiantion Marker.\n\nThe Pointer Direction Indicator can be attached to a VRTK_BasePointerRenderer in the `Direction Indicator` parameter and will the be used to send rotation data when the destination marker events are emitted.\n\nThis can be useful for rotating the play area upon teleporting to face the user in a new direction without expecting them to physically turn in the play space.\n\n## Inspector Parameters\n\n * **Include Headset Offset:** If this is checked then the reported rotation will include the offset of the headset rotation in relation to the play area.\n * **Display On Invalid Location:** If this is checked then the direction indicator will be displayed when the location is invalid.\n * **Use Pointer Color:** If this is checked then the pointer valid/invalid colours will also be used to change the colour of the direction indicator.\n\n## Class Events\n\n * `PointerDirectionIndicatorPositionSet` - Emitted when the object tooltip is reset.\n\n## Unity Events\n\nAdding the `VRTK_PointerDirectionIndicator_UnityEvents` component to `VRTK_PointerDirectionIndicator` 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## Class Methods\n\n### Initialize/1\n\n  > `public virtual void Initialize(VRTK_ControllerEvents events)`\n\n  * Parameters\n   * `VRTK_ControllerEvents events` - The Controller Events script that is used to control the direction indicator's rotation.\n  * Returns\n   * _none_\n\nThe Initialize method is used to set up the direction indicator.\n\n### SetPosition/2\n\n  > `public virtual void SetPosition(bool active, Vector3 position)`\n\n  * Parameters\n   * `bool active` - Determines if the direction indicator GameObject should be active or not.\n   * `Vector3 position` - The position to set the direction indicator to.\n  * Returns\n   * _none_\n\nThe SetPosition method is used to set the world position of the direction indicator.\n\n### GetRotation/0\n\n  > `public virtual Quaternion GetRotation()`\n\n  * Parameters\n   * _none_\n  * Returns\n   * `Quaternion` - The reported rotation of the direction indicator.\n\nThe GetRotation method returns the current reported rotation of the direction indicator.\n\n### SetMaterialColor/2\n\n  > `public virtual void SetMaterialColor(Color color, bool validity)`\n\n  * Parameters\n   * `Color color` - The colour to update the direction indicatormaterial to.\n   * `bool validity` - Determines if the colour being set is based from a valid location or invalid location.\n  * Returns\n   * _none_\n\nThe SetMaterialColor method sets the current material colour on the direction indicator.","excerpt":"","slug":"pointer-direction-indicator","type":"basic","title":"Pointer Direction Indicator"}

Pointer Direction Indicator


## Overview The Pointer Direction Indicator is used to determine a given world rotation that can be used by a Destiantion Marker. The Pointer Direction Indicator can be attached to a VRTK_BasePointerRenderer in the `Direction Indicator` parameter and will the be used to send rotation data when the destination marker events are emitted. This can be useful for rotating the play area upon teleporting to face the user in a new direction without expecting them to physically turn in the play space. ## Inspector Parameters * **Include Headset Offset:** If this is checked then the reported rotation will include the offset of the headset rotation in relation to the play area. * **Display On Invalid Location:** If this is checked then the direction indicator will be displayed when the location is invalid. * **Use Pointer Color:** If this is checked then the pointer valid/invalid colours will also be used to change the colour of the direction indicator. ## Class Events * `PointerDirectionIndicatorPositionSet` - Emitted when the object tooltip is reset. ## Unity Events Adding the `VRTK_PointerDirectionIndicator_UnityEvents` component to `VRTK_PointerDirectionIndicator` 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`. ## Class Methods ### Initialize/1 > `public virtual void Initialize(VRTK_ControllerEvents events)` * Parameters * `VRTK_ControllerEvents events` - The Controller Events script that is used to control the direction indicator's rotation. * Returns * _none_ The Initialize method is used to set up the direction indicator. ### SetPosition/2 > `public virtual void SetPosition(bool active, Vector3 position)` * Parameters * `bool active` - Determines if the direction indicator GameObject should be active or not. * `Vector3 position` - The position to set the direction indicator to. * Returns * _none_ The SetPosition method is used to set the world position of the direction indicator. ### GetRotation/0 > `public virtual Quaternion GetRotation()` * Parameters * _none_ * Returns * `Quaternion` - The reported rotation of the direction indicator. The GetRotation method returns the current reported rotation of the direction indicator. ### SetMaterialColor/2 > `public virtual void SetMaterialColor(Color color, bool validity)` * Parameters * `Color color` - The colour to update the direction indicatormaterial to. * `bool validity` - Determines if the colour being set is based from a valid location or invalid location. * Returns * _none_ The SetMaterialColor method sets the current material colour on the direction indicator.