# gvr::ControllerState

`#include <gvr_controller.h>`

Convenience C++ wrapper for the opaque gvr_controller_state type.

## Summary

See the gvr_controller_state functions for more information.

### Inheritance

Inherits from: [gvr::WrapperBase\< gvr_controller_state, gvr_controller_state_destroy \>](https://developers.google.com/vr/reference/android-ndk/class/gvr/wrapper-base)

| ### Constructors and Destructors ||
|---|---|
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a900d6a9495ba1231ca81e78ef5f71327()` ||

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a7d019ab2983e36a40c3f9596e6d4d11f() const ` | `https://developers.google.com/vr/reference/android-ndk/struct/gvr-vec3f#structgvr__vec3f` For more information, see [gvr_controller_state_get_accel()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gae7aecdd8d7b111109c31bcaee4deba4e). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a6fd0455cb4d932e0eb09f21ddf36541e() const ` | `https://developers.google.com/vr/reference/android-ndk/group/types#group__types_1gaae9868cb18a642676cc9ca2364adee8d` For more information, see [gvr_controller_state_get_api_status()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga3ec7d19219d362f2a6cd59b7ae9ae4d0). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a41add352d7cde440204c9f7789ed0ff6() const ` | `bool` For more information, see gvr_controller_state_get_battery_charging. |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1ab89ab8c7583872bfd1d57bda08368f0b() const ` | `https://developers.google.com/vr/reference/android-ndk/group/types#group__types_1ga5fa47795f01fd630034592fe562669ce` For more information, see gvr_controller_state_get_battery_level. |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1ac195bc2d8b765f486a33e08989fc2bb2(https://developers.google.com/vr/reference/android-ndk/group/types#group__types_1ga25a81f172e4de5c794b8f3ddb6194f41 button) const ` | `bool` For more information, see [gvr_controller_state_get_button_down()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga6faaf1b41fbe33f615620c2b95b1bae3). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a5ebfff26ca47220c7a81392998352a44(https://developers.google.com/vr/reference/android-ndk/group/types#group__types_1ga25a81f172e4de5c794b8f3ddb6194f41 button) const ` | `bool` For more information, see [gvr_controller_state_get_button_state()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gac6de78b19cb53d37781e90e548350780). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a241dcc79f79bc055390f197d69e0984d(https://developers.google.com/vr/reference/android-ndk/group/types#group__types_1ga25a81f172e4de5c794b8f3ddb6194f41 button) const ` | `bool` For more information, see [gvr_controller_state_get_button_up()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga31b8c9926c1f84be4ece21f39829c7d5). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1abb439b89676eae817b34e4420a0ed4a7() const ` | `https://developers.google.com/vr/reference/android-ndk/group/types#group__types_1gaedb36d874b0add14801d22bdf2b64e9f` For more information, see [gvr_controller_state_get_connection_state()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga9b5868109afdd7c020d43f1f3b330605). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a7caf1309642fa0fc75de937d6ad8a948() const ` | `https://developers.google.com/vr/reference/android-ndk/struct/gvr-vec3f#structgvr__vec3f` For more information, see [gvr_controller_state_get_gyro()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga35ba963180998517cdbb1892985d4015). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1ac3405345841ff6d5d0947e120aad33dd() const ` | `int64_t` For more information, see [gvr_controller_state_get_last_accel_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gaff5086b2d704e28945dfbf2baf0078a2). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a47824710d46ba303b80cccb62399065b() const ` | `int64_t` For more information, see gvr_controller_state_get_last_battery_timestamp. |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1aef2cc09aef0199a8d07b31d23738d8fe() const ` | `int64_t` For more information, see [gvr_controller_state_get_last_button_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gacc8af5ac8391c75f6a02d9e60eaa4a3f). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a20e9d79c1789ea4e37837a4a2e9f5ce3() const ` | `int64_t` For more information, see [gvr_controller_state_get_last_gyro_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga12117a8e88b1b68ed4ef64e549b8c275). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a5b9d07e908de48237c03bfaec6ee8899() const ` | `int64_t` For more information, see [gvr_controller_state_get_last_orientation_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gae68e157eb1a9fa7232d791523f5cd741). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a73b03d0313599e2d33b63e6f7fa193c1() const ` | `int64_t` For more information, see [gvr_controller_state_get_last_position_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga939a2fe479285a3d981ded17be168844). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a2dfb39d78e176740551a89f0b64b2f4f() const ` | `int64_t` For more information, see [gvr_controller_state_get_last_touch_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga269383786720e890203fd553af76ccfa). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a011895d1f9e66477937626ea43f7dec2() const ` | `https://developers.google.com/vr/reference/android-ndk/struct/gvr-quatf#structgvr__quatf` For more information, see [gvr_controller_state_get_orientation()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga99ec46279fc0450b4dd450dd7fe283b2). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1ae444efe4f674949c584437f27ffef5cf() const ` | `https://developers.google.com/vr/reference/android-ndk/struct/gvr-vec3f#structgvr__vec3f` For more information, see [gvr_controller_state_get_position()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga511434dcdb95e1c5598f55eef66107d4). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a58ace9f57ff9c64f4fdc0c461077faef() const ` | `bool` For more information, see [gvr_controller_state_get_recentered()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga0c2955ccc31961abe982f883085efac4). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1ac97ef5086cbd889e035527fe8fcf4620() const ` | `bool` For more information, see [gvr_controller_state_get_recentering()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga26f987daf961e2cbd8890106e991db0b). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a50a3a808b5a3811d966d8b212ea55196() const ` | `bool` For more information, see [gvr_controller_state_get_touch_down()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga1adbf36fd9d860ffd43d330d2c22b8e3). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1aa3e55d110ba79463484b479d7749fda7() const ` | `https://developers.google.com/vr/reference/android-ndk/struct/gvr-vec2f#structgvr__vec2f` For more information, see [gvr_controller_state_get_touch_pos()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga7818b83ec6a3d8baa708a6078adc28ad). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a81f0d86b7da8c2ff416a25a3fb6be217() const ` | `bool` For more information, see [gvr_controller_state_get_touch_up()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga1817bd3f2b7dd97d1ecdd237a344f0fa). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1ab77913b08c4589b825d3d8d42723bde2() const ` | `bool` For more information, see [gvr_controller_state_is_touching()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga6d0f199134dcc27990c5ea6bbaddf3c0). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1a0de3a7a987ff01741ac11612d44e615f(const https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-api#classgvr_1_1_controller_api & api)` | `void` For more information, see [gvr_controller_state_update()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga3c0c35e5604b6f35345d062090a9dc7e). |
| `https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-state#classgvr_1_1_controller_state_1adb5c41a675792f17c7bd70fc28d12f68(const https://developers.google.com/vr/reference/android-ndk/class/gvr/controller-api#classgvr_1_1_controller_api & api, int32_t controller_index)` | `void` For more information, see [gvr_controller_state_update()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga3c0c35e5604b6f35345d062090a9dc7e). |

## Public functions

### ControllerState

```
 ControllerState()
```

### GetAccel

```
gvr_vec3f GetAccel() const 
```
For more information, see [gvr_controller_state_get_accel()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gae7aecdd8d7b111109c31bcaee4deba4e).

### GetApiStatus

```
ControllerApiStatus GetApiStatus() const 
```
For more information, see [gvr_controller_state_get_api_status()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga3ec7d19219d362f2a6cd59b7ae9ae4d0).

### GetBatteryCharging

```
bool GetBatteryCharging() const 
```
For more information, see gvr_controller_state_get_battery_charging.

### GetBatteryLevel

```
ControllerBatteryLevel GetBatteryLevel() const 
```
For more information, see gvr_controller_state_get_battery_level.

### GetButtonDown

```
bool GetButtonDown(
  ControllerButton button
) const 
```
For more information, see [gvr_controller_state_get_button_down()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga6faaf1b41fbe33f615620c2b95b1bae3).

### GetButtonState

```
bool GetButtonState(
  ControllerButton button
) const 
```
For more information, see [gvr_controller_state_get_button_state()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gac6de78b19cb53d37781e90e548350780).

### GetButtonUp

```
bool GetButtonUp(
  ControllerButton button
) const 
```
For more information, see [gvr_controller_state_get_button_up()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga31b8c9926c1f84be4ece21f39829c7d5).

### GetConnectionState

```
ControllerConnectionState GetConnectionState() const 
```
For more information, see [gvr_controller_state_get_connection_state()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga9b5868109afdd7c020d43f1f3b330605).

### GetGyro

```
gvr_vec3f GetGyro() const 
```
For more information, see [gvr_controller_state_get_gyro()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga35ba963180998517cdbb1892985d4015).

### GetLastAccelTimestamp

```
int64_t GetLastAccelTimestamp() const 
```
For more information, see [gvr_controller_state_get_last_accel_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gaff5086b2d704e28945dfbf2baf0078a2).

### GetLastBatteryTimestamp

```
int64_t GetLastBatteryTimestamp() const 
```
For more information, see gvr_controller_state_get_last_battery_timestamp.

### GetLastButtonTimestamp

```
int64_t GetLastButtonTimestamp() const 
```
For more information, see [gvr_controller_state_get_last_button_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gacc8af5ac8391c75f6a02d9e60eaa4a3f).

### GetLastGyroTimestamp

```
int64_t GetLastGyroTimestamp() const 
```
For more information, see [gvr_controller_state_get_last_gyro_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga12117a8e88b1b68ed4ef64e549b8c275).

### GetLastOrientationTimestamp

```
int64_t GetLastOrientationTimestamp() const 
```
For more information, see [gvr_controller_state_get_last_orientation_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1gae68e157eb1a9fa7232d791523f5cd741).

### GetLastPositionTimestamp

```
int64_t GetLastPositionTimestamp() const 
```
For more information, see [gvr_controller_state_get_last_position_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga939a2fe479285a3d981ded17be168844).

### GetLastTouchTimestamp

```
int64_t GetLastTouchTimestamp() const 
```
For more information, see [gvr_controller_state_get_last_touch_timestamp()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga269383786720e890203fd553af76ccfa).

### GetOrientation

```
gvr_quatf GetOrientation() const 
```
For more information, see [gvr_controller_state_get_orientation()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga99ec46279fc0450b4dd450dd7fe283b2).

### GetPosition

```
gvr_vec3f GetPosition() const 
```
For more information, see [gvr_controller_state_get_position()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga511434dcdb95e1c5598f55eef66107d4).

### GetRecentered

```
bool GetRecentered() const 
```
For more information, see [gvr_controller_state_get_recentered()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga0c2955ccc31961abe982f883085efac4).

### GetRecentering

```
bool GetRecentering() const 
```
For more information, see [gvr_controller_state_get_recentering()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga26f987daf961e2cbd8890106e991db0b).

### GetTouchDown

```
bool GetTouchDown() const 
```
For more information, see [gvr_controller_state_get_touch_down()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga1adbf36fd9d860ffd43d330d2c22b8e3).

### GetTouchPos

```
gvr_vec2f GetTouchPos() const 
```
For more information, see [gvr_controller_state_get_touch_pos()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga7818b83ec6a3d8baa708a6078adc28ad).

### GetTouchUp

```
bool GetTouchUp() const 
```
For more information, see [gvr_controller_state_get_touch_up()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga1817bd3f2b7dd97d1ecdd237a344f0fa).

### IsTouching

```
bool IsTouching() const 
```
For more information, see [gvr_controller_state_is_touching()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga6d0f199134dcc27990c5ea6bbaddf3c0).

### Update

```
void Update(
  const ControllerApi & api
)
```
For more information, see [gvr_controller_state_update()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga3c0c35e5604b6f35345d062090a9dc7e).

### Update

```
void Update(
  const ControllerApi & api,
  int32_t controller_index
)
```
For more information, see [gvr_controller_state_update()](https://developers.google.com/vr/reference/android-ndk/group/controller#group___controller_1ga3c0c35e5604b6f35345d062090a9dc7e).