Adds a Pointer Direction Indicator to a pointer renderer and determines a given world rotation that can be used by a Destiantion Marker.
- Place the
VRTK/Prefabs/PointerDirectionIndicator/PointerDirectionIndicatorprefab into the scene hierarchy.
- Attach the
PointerDirectionIndicatorscene GameObejct to the
Direction Indicatorinspector parameter on a
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.
- Touchpad Deadzone: The touchpad axis needs to be above this deadzone for it to register as a valid touchpad angle.
- Coordinate Axis: The axis to use for the direction coordinates.
- 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.
- Indicator Visibility: Determines when the direction indicator will be visible.
public enum VisibilityState- States of Direction Indicator Visibility.
OnWhenPointerActive- Only shows the direction indicator when the pointer is active.
AlwaysOnWithPointerCursor- Only shows the direction indicator when the pointer cursor is visible or if the cursor is hidden and the pointer is active.
PointerDirectionIndicatorPositionSet- Emitted when the object tooltip is reset.
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
public virtual void Initialize(VRTK_ControllerEvents events)
VRTK_ControllerEvents events- The Controller Events script that is used to control the direction indicator's rotation.
The Initialize method is used to set up the direction indicator.
public virtual void SetPosition(bool active, Vector3 position)
bool active- Determines if the direction indicator GameObject should be active or not.
Vector3 position- The position to set the direction indicator to.
The SetPosition method is used to set the world position of the direction indicator.
public virtual Quaternion GetRotation()
Quaternion- The reported rotation of the direction indicator.
The GetRotation method returns the current reported rotation of the direction indicator.
public virtual void SetMaterialColor(Color color, bool validity)
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.
The SetMaterialColor method sets the current material colour on the direction indicator.
public virtual VRTK_ControllerEvents GetControllerEvents()
VRTK_ControllerEvents- The associated Controller Events script.
The GetControllerEvents method returns the associated Controller Events script with the Pointer Direction Indicator script.
Updated less than a minute ago