# GvrLaserPointer Class Reference

# GvrLaserPointer

Implementation of [GvrBasePointer](https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer) for a laser pointer visual.

## Summary

This script should be attached to the controller object. The laser visual is important to help users locate their cursor when its not directly in their field of view.

### Inheritance

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

| ### Public attributes ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1ae6530796a9bc05e29666fd2195aaa980 = 20.0f` | `float` Distance from the pointer that the reticle will be drawn at when hitting nothing. |
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1a4eef42de2d9247f91d5a7f2ee6d65650 = 20.0f` | `float` Maximum distance from the pointer that raycast hits will be detected. |
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1aa2c589e6b0eadf38505096b22ec42050` | `float` By default, the length of the laser is used as the CameraRayIntersectionDistance. |

| ### Properties ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1a92683fbe0809af15e27a7ab8b0e11f0e` | `override float` |
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1a2a57f1e672c2032a51ee3d59c1d763ba` | `https://developers.google.com/vr/reference/unity/class/GvrLaserVisual#classGvrLaserVisual` Gets the visual object for the laser beam. |
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1a41ff424a067e3a46e73a1f5a4aca622e` | `override float` |

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1ae48930542cc1f6aab672dc395ab1eec7(out float enterRadius, out float exitRadius)` | `virtual override void` Return the radius of the pointer. |
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1a5f1b68216f5cece492cdde12c4e7bbc9()` | `virtual override void` Called when a click is initiated. |
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1a6d0ed35f5f7eb4f589cb03b473be7474()` | `virtual override void` Called when click is finished. |
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1aa4ecb6ae7dd95992dc5637a826331c33(RaycastResult raycastResult, bool isInteractive)` | `virtual override void` Called when the pointer is facing a valid GameObject. |
| `https://developers.google.com/vr/reference/unity/class/GvrLaserPointer#classGvrLaserPointer_1a21a71a130e27eb96c991b0b59ffade4d(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/GvrLaserPointer#classGvrLaserPointer_1a78732710d8b8f6ff3c2a729fc0ffb4fd(RaycastResult raycastResult, bool isInteractive)` | `virtual override void` Called every frame the user is still pointing at a valid GameObject. |

## Public attributes

### defaultReticleDistance

```c#
float defaultReticleDistance = 20.0f
```
Distance from the pointer that the reticle will be drawn at when hitting nothing.

### maxPointerDistance

```c#
float maxPointerDistance = 20.0f
```
Maximum distance from the pointer that raycast hits will be detected.

### overrideCameraRayIntersectionDistance

```c#
float overrideCameraRayIntersectionDistance
```
By default, the length of the laser is used as the CameraRayIntersectionDistance.

Set this field to a non-zero value to override it.

## Properties

### CameraRayIntersectionDistance

```c#
override float CameraRayIntersectionDistance
```

### LaserVisual

```c#
GvrLaserVisual LaserVisual
```
Gets the visual object for the laser beam.

The visual object for the laser beam.

### MaxPointerDistance

```c#
override float MaxPointerDistance
```

## 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 raycastResult,
  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 raycastResult,
  bool isInteractive
)
```
Called every frame the user is still pointing at a valid GameObject.