# GvrReticlePointer Class Reference

# GvrReticlePointer

Draws a circular reticle in front of any object that the user points at.

## Summary

The circle dilates if the object is clickable.

### Inheritance

Inherits from: [GvrBasePointer](https://developers.google.com/vr/reference/unity/class/GvrBasePointer)

| ### Public attributes ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1af724e90376537d28dcda7a525ea70a6a = 0.45f` | `const float` Minimum distance of the reticle (in meters). |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1aaadd0a928634da2d69a82992e8afc800 = 1.5f` | `const float` Angle at which to expand the reticle when intersecting with an object (in degrees). |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a8739abf105806b1574dbc021e5cee61e = 0.0f` | `const float` The constants below are expsed for testing. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a0e799eb59de15bcebb43135aacce4d8f = 0.5f` | `const float` Minimum outer angle of the reticle (in degrees). |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1acc18568e055895cf991404bd544de3c1 = 20.0f` | `float` Maximum distance of the reticle (in meters). |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a9e91ed81a5e4adc314669ec07778ada0 = 8.0f` | `float` Growth speed multiplier for the reticle. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a09f74e5ae354ef2b99c9192f643710f8 = 20` | `int` Number of segments making the reticle circle. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1aaca03712b55529f9c3c424e5aff0734b = 32767` | `int` Sorting order to use for the reticle's renderer. |

| ### Properties ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a9826b0f68864f79316567bb06aa17bb9` | `Material` Gets or sets the material used to render the reticle. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a291a6328a73f47b4c55ad2340b9c2f6c` | `override float` |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1ad0e091c488ec29cd7e11049854d1ad43` | `float` Gets the current distance of the reticle (in meters). |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1ac3563ff92dc467a1e28bcd931c300482` | `float` Gets the current inner angle of the reticle (in degrees). |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1ae81106e34b34de6e00d05233b4bebfda` | `float` Gets the current inner and outer diameters of the reticle, before distance multiplication. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a6642baf240c60b79e58847794a45a669` | `float` Gets the current outer angle of the reticle (in degrees). |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a288a8d085a9f885d5d58fa595424e966` | `float` Gets the current outer diameter of the reticle (in meters). |

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1ace2299ed7fd8211253095f147b45d350(out float enterRadius, out float exitRadius)` | `virtual override void` Return the radius of the pointer. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1aabce3a347c939cd1610ece09209a86f8()` | `virtual override void` Called when a click is initiated. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1ae94dbd2dbb45e0020109e22e0907ae5b()` | `virtual override void` Called when click is finished. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a7318603d3e4f919a4df8f2fc02ea71ea(RaycastResult raycastResultResult, bool isInteractive)` | `virtual override void` Called when the pointer is facing a valid GameObject. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1ace8e61dbce93fa0d93b5fe55f0ff4959(GameObject previousObject)` | `virtual override void` Called when the pointer no longer faces an object previously intersected with a ray projected from the camera. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1a9dcba50334970634aa7582fb8767482c(RaycastResult raycastResultResult, bool isInteractive)` | `virtual override void` Called every frame the user is still pointing at a valid GameObject. |
| `https://developers.google.com/vr/reference/unity/class/GvrReticlePointer#classGvrReticlePointer_1ad95c10ee7dc0756fa4123f9e8acea3ad()` | `void` Updates the material based on the reticle properties. |

## Public attributes

### RETICLE_DISTANCE_MIN

```c#
const float RETICLE_DISTANCE_MIN = 0.45f
```
Minimum distance of the reticle (in meters).

### RETICLE_GROWTH_ANGLE

```c#
const float RETICLE_GROWTH_ANGLE = 1.5f
```
Angle at which to expand the reticle when intersecting with an object (in degrees).

### RETICLE_MIN_INNER_ANGLE

```c#
const float RETICLE_MIN_INNER_ANGLE = 0.0f
```
The constants below are expsed for testing.

Minimum inner angle of the reticle (in degrees).

### RETICLE_MIN_OUTER_ANGLE

```c#
const float RETICLE_MIN_OUTER_ANGLE = 0.5f
```
Minimum outer angle of the reticle (in degrees).

### maxReticleDistance

```c#
float maxReticleDistance = 20.0f
```
Maximum distance of the reticle (in meters).

### reticleGrowthSpeed

```c#
float reticleGrowthSpeed = 8.0f
```
Growth speed multiplier for the reticle.

### reticleSegments

```c#
int reticleSegments = 20
```
Number of segments making the reticle circle.

### reticleSortingOrder

```c#
int reticleSortingOrder = 32767
```
Sorting order to use for the reticle's renderer.

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

Default value 32767 ensures gaze reticle is always rendered on top.

## Properties

### MaterialComp

```c#
Material MaterialComp
```
Gets or sets the material used to render the reticle.

The material used to render the reticle.

### MaxPointerDistance

```c#
override float MaxPointerDistance
```

### ReticleDistanceInMeters

```c#
float ReticleDistanceInMeters
```
Gets the current distance of the reticle (in meters).

Getter exposed for testing.

The current distance of the reticle (in meters).

### ReticleInnerAngle

```c#
float ReticleInnerAngle
```
Gets the current inner angle of the reticle (in degrees).

Exposed for testing.

The current inner angle of the reticle (in degrees).

### ReticleInnerDiameter

```c#
float ReticleInnerDiameter
```
Gets the current inner and outer diameters of the reticle, before distance multiplication.

Getters exposed for testing.

The current inner and outer diameters of the reticle, before distance multiplication.

### ReticleOuterAngle

```c#
float ReticleOuterAngle
```
Gets the current outer angle of the reticle (in degrees).

Exposed for testing.

The current outer angle of the reticle (in degrees).

### ReticleOuterDiameter

```c#
float ReticleOuterDiameter
```
Gets the current outer diameter of the reticle (in meters).

The current outer diameter of the reticle (in meters).

## Public functions

### GetPointerRadius

```c#
virtual override void GetPointerRadius(
  out float enterRadius,
  out float exitRadius
)
```
Return the radius of the pointer.

### OnPointerClickDown

```c#
virtual override void OnPointerClickDown()
```
Called when a click is initiated.

### OnPointerClickUp

```c#
virtual override void OnPointerClickUp()
```
Called when click is finished.

### OnPointerEnter

```c#
virtual override void OnPointerEnter(
  RaycastResult raycastResultResult,
  bool isInteractive
)
```
Called when the pointer is facing a valid GameObject.

### OnPointerExit

```c#
virtual override void OnPointerExit(
  GameObject previousObject
)
```
Called when the pointer no longer faces an object previously intersected with a ray projected from the camera.

### OnPointerHover

```c#
virtual override void OnPointerHover(
  RaycastResult raycastResultResult,
  bool isInteractive
)
```
Called every frame the user is still pointing at a valid GameObject.

### UpdateDiameters

```c#
void UpdateDiameters()
```
Updates the material based on the reticle properties.