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

VRTK_OutlineObjectCopyHighlighter

extends VRTK_BaseHighlighter

Overview

The Outline Object Copy Highlighter works by making a copy of a mesh and adding an outline shader to it and toggling the appearance of the highlighted object.

Inspector Parameters

  • Thickness: The thickness of the outline effect
  • Custom Outline Models: The GameObjects to use as the model to outline. If one isn't provided then the first GameObject with a valid Renderer in the current GameObject hierarchy will be used.
  • Custom Outline Model Paths: A path to a GameObject to find at runtime, if the GameObject doesn't exist at edit time.
  • Enable Submesh Highlight: If the mesh has multiple sub-meshes to highlight then this should be checked, otherwise only the first mesh will be highlighted.

Class Methods

Initialise/2

public override void Initialise(Color? color = null, Dictionary<string, object> options = null)

  • Parameters
  • Color? color - Not used.
  • Dictionary<string, object> options - A dictionary array containing the highlighter options:\r <'thickness', float> - Same as thickness inspector parameter.\r <'customOutlineModels', GameObject[]> - Same as customOutlineModels inspector parameter.\r * <'customOutlineModelPaths', string[]> - Same as customOutlineModelPaths inspector parameter.
  • Returns
  • none

The Initialise method sets up the highlighter for use.

ResetHighlighter/0

public override void ResetHighlighter()

  • Parameters
  • none
  • Returns
  • none

The ResetHighlighter method creates the additional model to use as the outline highlighted object.

Highlight/2

public override void Highlight(Color? color, float duration = 0f)

  • Parameters
  • Color? color - The colour to outline with.
  • float duration - Not used.
  • Returns
  • none

The Highlight method initiates the outline object to be enabled and display the outline colour.

Unhighlight/2

public override void Unhighlight(Color? color = null, float duration = 0f)

  • Parameters
  • Color? color - Not used.
  • float duration - Not used.
  • Returns
  • none

The Unhighlight method hides the outline object and removes the outline colour.

Example

VRTK/Examples/005_Controller_BasicObjectGrabbing demonstrates the outline highlighting on the green sphere when the controller touches it.

VRTK/Examples/035_Controller_OpacityAndHighlighting demonstrates the outline highlighting if the left controller collides with the green box.