GvrControllerReticleVisual

Visualizes a reticle using a Quad.

Summary

Provides tuning options to control how the reticle scales and rotates based on distance from the camera.

Inheritance

Inherits from: MonoBehaviour

Public attributes

doesReticleFaceCamera = new FaceCameraData(true)
isSizeBasedOnCameraDistance = true
bool
If set to false, the scale is simply set to the sizeMeters value.
sizeMeters = 0.1f
float
The reticle will be scaled based on the size of the mesh so that it's size matches this size.
sortingOrder = 0
int
Sorting order to use for the reticle's renderer.

Properties

ReticleMeshSizeMeters
float
The size of the reticle's mesh in meters.
ReticleMeshSizeRatio
float
The ratio of the reticleMeshSizeMeters to 1 meter.

Protected attributes

meshFilter
MeshFilter
meshRenderer
MeshRenderer

Public functions

RefreshMesh()
void

Protected functions

Awake()
virtual void
OnEnable()
virtual void
OnRenderObject()
virtual void
OnValidate()
virtual void
OnWillRenderObject()
virtual void
UpdateReticleOrientation(Camera camera)
virtual void
UpdateReticleSize(Camera camera)
virtual void

Structs

GvrControllerReticleVisual.FaceCameraData

Public attributes

doesReticleFaceCamera

FaceCameraData doesReticleFaceCamera = new FaceCameraData(true)

isSizeBasedOnCameraDistance

bool isSizeBasedOnCameraDistance = true

If set to false, the scale is simply set to the sizeMeters value.

sizeMeters

float sizeMeters = 0.1f

The reticle will be scaled based on the size of the mesh so that it's size matches this size.

sortingOrder

int sortingOrder = 0

Sorting order to use for the reticle's renderer.

Range values come from https://docs.unity3d.com/ScriptReference/Renderer-sortingOrder.html.

Properties

ReticleMeshSizeMeters

float ReticleMeshSizeMeters

The size of the reticle's mesh in meters.

ReticleMeshSizeRatio

float ReticleMeshSizeRatio

The ratio of the reticleMeshSizeMeters to 1 meter.

If reticleMeshSizeMeters is 10, then reticleMeshSizeRatio is 0.1.

Protected attributes

meshFilter

MeshFilter meshFilter

meshRenderer

MeshRenderer meshRenderer

Public functions

RefreshMesh

void RefreshMesh()

Protected functions

Awake

virtual void Awake()

OnEnable

virtual void OnEnable()

OnRenderObject

virtual void OnRenderObject()

OnValidate

virtual void OnValidate()

OnWillRenderObject

virtual void OnWillRenderObject()

UpdateReticleOrientation

virtual void UpdateReticleOrientation(
  Camera camera
)

UpdateReticleSize

virtual void UpdateReticleSize(
  Camera camera
)