# GvrControllerReticleVisual Class Reference

# 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 ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1a33d9948a554b85067ba6744fe9e2a881 = new FaceCameraData(true)` | `https://developers.google.com/vr/reference/unity/struct/GvrControllerReticleVisual/FaceCameraData#structGvrControllerReticleVisual_1_1FaceCameraData` Determines if the reticle will always face the camera and along which axes. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1a06ae567a078ba15b753be6628ef8f723 = true` | `bool` If `true`, the scale is based on Camera Distance. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1aed4b4a99bc55ed4c9c7b9136340b2b81 = 0.1f` | `float` The reticle will be scaled based on the size of the mesh so that its size matches this size. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1ac0262cd53e12134536c89f97297f985b = 0` | `int` Sorting order to use for the reticle's renderer. |

| ### Protected attributes ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1aef24255a276551bef199b1e5aaa76332` | `MeshFilter` The mesh filter for the reticle. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1a767798a6bc3489eb0487dd44d85e3d52` | `MeshRenderer` The mesh renderer for the reticle. |

| ### Properties ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1a2f7da944a08f8d3f583abb2411d7f549` | `float` Gets the size of the reticle's mesh in meters. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1abb0f2c5c23975b0a784fb0e58cc52025` | `float` Gets the ratio of the reticleMeshSizeMeters compared to 1 meter. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1abea9df9c34ede8af5022cad963a40e63()` | `void` Updates the mesh dimensions. |

| ### Protected functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1a8fa6e7dc69a6749660b6414af521a73a(Camera camera)` | `virtual void` Updates the reticle position and orientation based on the camera. |
| `https://developers.google.com/vr/reference/unity/class/GvrControllerReticleVisual#classGvrControllerReticleVisual_1a3e8094e878deebfdf06db5ca30f7818f(Camera camera)` | `virtual void` Update the recticle size based on the distance. |

| ### Structs ||
|---|---|
| [GvrControllerReticleVisual.FaceCameraData](https://developers.google.com/vr/reference/unity/struct/GvrControllerReticleVisual/FaceCameraData) | Camera facing positioning data. |

## Public attributes

### doesReticleFaceCamera

```c#
FaceCameraData doesReticleFaceCamera = new FaceCameraData(true)
```
Determines if the reticle will always face the camera and along which axes.

### isSizeBasedOnCameraDistance

```c#
bool isSizeBasedOnCameraDistance = true
```
If `true`, the scale is based on Camera Distance.

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

### sizeMeters

```c#
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

```c#
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

```c#
MeshFilter meshFilter
```
The mesh filter for the reticle.

### meshRenderer

```c#
MeshRenderer meshRenderer
```
The mesh renderer for the reticle.

## Properties

### ReticleMeshSizeMeters

```c#
float ReticleMeshSizeMeters
```
Gets the size of the reticle's mesh in meters.

The reticle mesh size in meters.

### ReticleMeshSizeRatio

```c#
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

```c#
void RefreshMesh()
```
Updates the mesh dimensions.

## Protected functions

### UpdateReticleOrientation

```c#
virtual void UpdateReticleOrientation(
  Camera camera
)
```
Updates the reticle position and orientation based on the camera.

Locks orientation angles according to `along*Axis` fields.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `camera` | The camera to update orientation to match. | |

### UpdateReticleSize

```c#
virtual void UpdateReticleSize(
  Camera camera
)
```
Update the recticle size based on the distance.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `camera` | The camera to update size relative to. | |