Guides

Pointer Origin Smoothing Settings

Overview

Provides a base that all pointer renderers can inherit from.

Script Usage:

This is an abstract class that is to be inherited to a concrete class that provides pointer renderer functionality, therefore this script should not be directly used.

Inspector Parameters

  • Smooths Position: Whether or not to smooth the position of the pointer origin when positioning the pointer tip.
  • Max Allowed Per Frame Distance Difference: The maximum allowed distance between the unsmoothed pointer origin and the smoothed pointer origin per frame to use for smoothing.
  • Smooths Rotation: Whether or not to smooth the rotation of the pointer origin when positioning the pointer tip.
  • Max Allowed Per Frame Angle Difference: The maximum allowed angle between the unsmoothed pointer origin and the smoothed pointer origin per frame to use for smoothing.
  • Playarea Cursor: An optional Play Area Cursor generator to add to the destination position of the pointer tip.
  • Direction Indicator: A custom VRTK_PointerDirectionIndicator to use to determine the rotation given to the destination set event.
  • Custom Raycast: A custom raycaster to use for the pointer's raycasts to ignore.
  • Pointer Origin Smoothing Settings: Specifies the smoothing to be applied to the pointer origin when positioning the pointer tip.
  • Valid Collision Color: The colour to change the pointer materials when the pointer collides with a valid object. Set to Color.clear to bypass changing material colour on valid collision.
  • Invalid Collision Color: The colour to change the pointer materials when the pointer is not colliding with anything or with an invalid object. Set to Color.clear to bypass changing material colour on invalid collision.
  • Tracer Visibility: Determines when the main tracer of the pointer renderer will be visible.
  • Cursor Visibility: Determines when the cursor/tip of the pointer renderer will be visible.

Class Variables

  • public enum VisibilityStates - States of Pointer Visibility.
    • OnWhenActive - Only shows the object when the pointer is active.
    • AlwaysOn - Ensures the object is always.
    • AlwaysOff - Ensures the object beam is never visible.

Class Methods

GetPointerObjects/0

public abstract 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.

InitalizePointer/4

public virtual void InitalizePointer(VRTK_Pointer givenPointer, VRTK_PolicyList givenInvalidListPolicy, VRTK_NavMeshData givenNavMeshData, bool givenHeadsetPositionCompensation)

  • Parameters
    • VRTK_Pointer givenPointer - The VRTK_Pointer that is controlling the pointer renderer.
    • VRTK_PolicyList givenInvalidListPolicy - The VRTK_PolicyList for managing valid and invalid pointer locations.
    • VRTK_NavMeshData givenNavMeshData - The NavMeshData object that contains the Nav Mesh restriction options.
    • bool givenHeadsetPositionCompensation - Determines whether the play area cursor will take the headset position within the play area into account when being displayed.
  • Returns
    • none

The InitalizePointer method is used to set up the state of the pointer renderer.

ResetPointerObjects/0

public virtual void ResetPointerObjects()

  • Parameters
    • none
  • Returns
    • none

The ResetPointerObjects method is used to destroy any existing pointer objects and recreate them at runtime.

Toggle/2

public virtual void Toggle(bool pointerState, bool actualState)

  • Parameters
    • bool pointerState - The activation state of the pointer.
    • bool actualState - The actual state of the activation button press.
  • Returns
    • none

The Toggle Method is used to enable or disable the pointer renderer.

ToggleInteraction/1

public virtual void ToggleInteraction(bool state)

  • Parameters
    • bool state - If true then the object interactor will be enabled.
  • Returns
    • none

The ToggleInteraction method is used to enable or disable the controller extension interactions.

UpdateRenderer/0

public virtual void UpdateRenderer()

  • Parameters
    • none
  • Returns
    • none

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

GetDestinationHit/0

public virtual RaycastHit GetDestinationHit()

  • Parameters
    • none
  • Returns
    • RaycastHit - The RaycastHit containing the information where the pointer is hitting.

The GetDestinationHit method is used to get the RaycastHit of the pointer destination.

ValidPlayArea/0

public virtual bool ValidPlayArea()

  • Parameters
    • none
  • Returns
    • bool - Returns true if there is a valid play area and no collisions. Returns false if there is no valid play area or there is but with a collision detected.

The ValidPlayArea method is used to determine if there is a valid play area and if it has had any collisions.

IsVisible/0

public virtual bool IsVisible()

  • Parameters
    • none
  • Returns
    • bool - Returns true if either the tracer or cursor renderers are visible. Returns false if none are visible.

The IsVisible method determines if the pointer renderer is at all visible by checking the state of the tracer and the cursor.

IsTracerVisible/0

public virtual bool IsTracerVisible()

  • Parameters
    • none
  • Returns
    • bool - Returns true if the tracer renderers are visible.

The IsTracerVisible method determines if the pointer tracer renderer is visible.

IsCursorVisible/0

public virtual bool IsCursorVisible()

  • Parameters
    • none
  • Returns
    • bool - Returns true if the cursor renderers are visible.

The IsCursorVisible method determines if the pointer cursor renderer is visible.

IsValidCollision/0

public virtual bool IsValidCollision()

  • Parameters
    • none
  • Returns
    • bool - Returns true if the pointer is in a valid collision, returns false if the pointer is in an invalid collision state.

The IsValidCollision method determines if the pointer is currently in it's valid collision state.

GetObjectInteractor/0

public virtual GameObject GetObjectInteractor()

  • Parameters
    • none
  • Returns
    • GameObject - The auto generated object interactor GameObject.
    • GameObject -

The GetObjectInteractor method returns the auto generated GameObject that acts as the controller extension for interacting with objects.