Guides
These docs are for v3.2.0. Click to read the latest docs for v3.3.0.

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.