Guides

VRTK_StraightPointerRenderer

extends VRTK_BasePointerRenderer

Overview

A visual pointer representation of a straight beam with an optional cursor at the end.

Optional Components:

  • VRTK_PlayAreaCursor - A Play Area Cursor that will track the position of the pointer cursor.
  • VRTK_PointerDirectionIndicator - A Pointer Direction Indicator that will track the position of the pointer cursor.

Script Usage:

  • Place the VRTK_StraightPointerRenderer script on the same GameObject as the Pointer script it is linked to.
  • Link this Pointer Renderer script to the Pointer Renderer parameter on the required Pointer script.

Script Dependencies:

  • A Pointer script to control the activation of this Pointer Renderer script.

Inspector Parameters

  • Maximum Length: The maximum length the pointer tracer can reach.
  • Scale Factor: The scale factor to scale the pointer tracer object by.
  • Cursor Scale Multiplier: The scale multiplier to scale the pointer cursor object by in relation to the Scale Factor.
  • Cursor Match Target Rotation: The cursor will be rotated to match the angle of the target surface if this is true, if it is false then the pointer cursor will always be horizontal.
  • Cursor Distance Rescale: Rescale the cursor proportionally to the distance from the tracer origin.
  • Maximum Cursor Scale: The maximum scale the cursor is allowed to reach. This is only used when rescaling the cursor proportionally to the distance from the tracer origin.
  • Custom Tracer: A custom game object to use as the appearance for the pointer tracer. If this is empty then a Box primitive will be created and used.
  • Custom Cursor: A custom game object to use as the appearance for the pointer cursor. If this is empty then a Sphere primitive will be created and used.

Class Methods

UpdateRenderer/0

public override void UpdateRenderer()

  • Parameters
    • none
  • Returns
    • none

The UpdateRenderer method is used to run an Update routine on the pointer.

GetPointerObjects/0

public override GameObject[] GetPointerObjects()

  • Parameters
    • none
  • Returns
    • GameObject[] - An array of pointer auto generated GameObjects.

The GetPointerObjects returns an array of the auto generated GameObjects associated with the pointer.

Example

VRTK/Examples/003_Controller_SimplePointer shows the simple pointer in action and code examples of how the events are utilised and listened to can be viewed in the script VRTK/Examples/ExampleResources/Scripts/VRTK_ControllerPointerEvents_ListenerExample.cs


Did this page help you?