# GvrVRHelpers Class Reference

# GvrVRHelpers

Helper functions common to GVR VR applications.

## Summary

| ### Public static functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrVRHelpers#classGvrVRHelpers_1a5126c2a351451048ab88920f9f632e0d()` | `Vector3` Gets the forward vector relative to the headset's rotation. |
| `https://developers.google.com/vr/reference/unity/class/GvrVRHelpers#classGvrVRHelpers_1af469f8ef23bfb0ee07c95e032aa48228()` | `Vector3` Gets the head's position. |
| `https://developers.google.com/vr/reference/unity/class/GvrVRHelpers#classGvrVRHelpers_1a85a23144335c954b449eddc5979cf4bb()` | `Quaternion` Gets the headset's rotation. |
| `https://developers.google.com/vr/reference/unity/class/GvrVRHelpers#classGvrVRHelpers_1ae1acb62d405023b575700be2c143ba03(https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fe mode)` | `float` Gets the distance at which the `Direct` and `Camera` raycasts intersect. |
| `https://developers.google.com/vr/reference/unity/class/GvrVRHelpers#classGvrVRHelpers_1a1233d60e6e6f19bdf5a410a59cdb0332(https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fe mode)` | `float` Gets the recommended max laser distance, based on raycast mode. |
| `https://developers.google.com/vr/reference/unity/class/GvrVRHelpers#classGvrVRHelpers_1a55e67b97109f440e0e24c87262840eea(https://developers.google.com/vr/reference/unity/class/GvrBasePointer#classGvrBasePointer_1a8de79b1db10e6f55fe6738a4358b73fe mode)` | `bool` Returns a value indicating whether the laser is visually shrunken. |
| `https://developers.google.com/vr/reference/unity/class/GvrVRHelpers#classGvrVRHelpers_1aa9b3cb23757be3c2330b90e5a5ae2c8b()` | `Vector2` Gets the center of the screen or eye texture, in pixels. |

## Public static functions

### GetHeadForward

```c#
Vector3 GetHeadForward()
```
Gets the forward vector relative to the headset's rotation.

<br />

| Details ||
|---|---|
| **Returns** | The forward vector relative to the headset's rotation. |

### GetHeadPosition

```c#
Vector3 GetHeadPosition()
```
Gets the head's position.

<br />

| Details ||
|---|---|
| **Returns** | The head's position. |

### GetHeadRotation

```c#
Quaternion GetHeadRotation()
```
Gets the headset's rotation.

<br />

| Details ||
|---|---|
| **Returns** | The headset's rotation. |

### GetRayIntersection

```c#
float GetRayIntersection(
  GvrBasePointer.RaycastMode mode
)
```
Gets the distance at which the `Direct` and `Camera` raycasts intersect.

This is the point at which `Hybrid` mode will transition from `Direct` (closer than the intersection) to `Camera` (further than the intersection) mode.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `mode` | The `RaycastMode` for which to get the intersection distance. Only returns non-zero when this is `RaycastMode.Camera`. | |
| **Returns** | The distance at which the `Direct` and `Camera` raycasts intersect. |

### GetRecommendedMaxLaserDistance

```c#
float GetRecommendedMaxLaserDistance(
  GvrBasePointer.RaycastMode mode
)
```
Gets the recommended max laser distance, based on raycast mode.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `mode` | The `RaycastMode` for which to get the recommended distance. | |
| **Returns** | The recommended maximum laser distance for the given mode. |

### GetShrinkLaser

```c#
bool GetShrinkLaser(
  GvrBasePointer.RaycastMode mode
)
```
Returns a value indicating whether the laser is visually shrunken.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `mode` | The `RaycastMode` for which to check behavior. | |
| **Returns** | Returns `true` if the laser is shrunken, `false`a otherwise. |

### GetViewportCenter

```c#
Vector2 GetViewportCenter()
```
Gets the center of the screen or eye texture, in pixels.

<br />

| Details ||
|---|---|
| **Returns** | The center of the screen, in pixels. |