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

VRTK_StraightPointerRenderer

extends VRTK_BasePointerRenderer

Overview

The Straight Pointer Renderer emits a coloured beam from the end of the object it is attached to and simulates a laser beam.

It can be useful for pointing to objects within a scene and it can also determine the object it is pointing at and the distance the object is from the controller the beam is being emitted from.

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/Resources/Scripts/VRTK_ControllerPointerEvents_ListenerExample.cs