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)
Determines if the reticle will always face the camera and along which axes.
isSizeBasedOnCameraDistance = true
bool
If true, the scale is based on Camera Distance.
sizeMeters = 0.1f
float
The reticle will be scaled based on the size of the mesh so that its size matches this size.
sortingOrder = 0
int
Sorting order to use for the reticle's renderer.

Protected attributes

meshFilter
MeshFilter
The mesh filter for the reticle.
meshRenderer
MeshRenderer
The mesh renderer for the reticle.

Properties

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

Public functions

RefreshMesh()
void
Updates the mesh dimensions.

Protected functions

UpdateReticleOrientation(Camera camera)
virtual void
Updates the reticle position and orientation based on the camera.
UpdateReticleSize(Camera camera)
virtual void
Update the recticle size based on the distance.

Structs

GvrControllerReticleVisual.FaceCameraData

Camera facing positioning data.

Public attributes

doesReticleFaceCamera

FaceCameraData doesReticleFaceCamera = new FaceCameraData(true)

Determines if the reticle will always face the camera and along which axes.

isSizeBasedOnCameraDistance

bool isSizeBasedOnCameraDistance = true

If true, the scale is based on Camera Distance.

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

sizeMeters

float sizeMeters = 0.1f

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

Final size of the reticle in meters when it is 1 meter from the camera.

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.

Protected attributes

meshFilter

MeshFilter meshFilter

The mesh filter for the reticle.

meshRenderer

MeshRenderer meshRenderer

The mesh renderer for the reticle.

Properties

ReticleMeshSizeMeters

float ReticleMeshSizeMeters

Gets the size of the reticle's mesh in meters.

The reticle mesh size in meters.

ReticleMeshSizeRatio

float ReticleMeshSizeRatio

Gets the ratio of the reticleMeshSizeMeters compared to 1 meter.

If reticleMeshSizeMeters is 10, then reticleMeshSizeRatio is 0.1.

The reticle mesh size ratio.

Public functions

RefreshMesh

void RefreshMesh()

Updates the mesh dimensions.

Protected functions

UpdateReticleOrientation

virtual void UpdateReticleOrientation(
  Camera camera
)

Updates the reticle position and orientation based on the camera.

Locks orientation angles according to along*Axis fields.

Details
Parameters
camera
The camera to update orientation to match.

UpdateReticleSize

virtual void UpdateReticleSize(
  Camera camera
)

Update the recticle size based on the distance.

Details
Parameters
camera
The camera to update size relative to.