This site has been archived and remains strictly as a historical reference for developers who actively maintain apps built using the legacy Google VR SDK, which was last updated in 2019 and is no longer receiving updates.
  • All developers actively developing experiences for Google Cardboard should use the new open source Cardboard SDKs for iOS, Android NDK, and Unity XR Plugin. These new SDKs offer streamlined APIs, improved device compatibility, and built-in viewer profile QR code scanning.
  • The Daydream View VR headset is no longer available for purchase as of October 15, 2019. Existing apps on supported devices are unaffected for users who previously installed those applications. It is no longer possible to opt-in to Daydream distribution via Google Play.

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 >

Constructors and Destructors

ControllerState()

Public functions

GetAccel() const
For more information, see gvr_controller_state_get_accel().
GetApiStatus() const
For more information, see gvr_controller_state_get_api_status().
GetBatteryCharging() const
bool
For more information, see gvr_controller_state_get_battery_charging.
GetBatteryLevel() const
For more information, see gvr_controller_state_get_battery_level.
GetButtonDown(ControllerButton button) const
bool
For more information, see gvr_controller_state_get_button_down().
GetButtonState(ControllerButton button) const
bool
For more information, see gvr_controller_state_get_button_state().
GetButtonUp(ControllerButton button) const
bool
For more information, see gvr_controller_state_get_button_up().
GetConnectionState() const
GetGyro() const
For more information, see gvr_controller_state_get_gyro().
GetLastAccelTimestamp() const
int64_t
GetLastBatteryTimestamp() const
int64_t
For more information, see gvr_controller_state_get_last_battery_timestamp.
GetLastButtonTimestamp() const
int64_t
GetLastGyroTimestamp() const
int64_t
GetLastOrientationTimestamp() const
int64_t
GetLastPositionTimestamp() const
int64_t
GetLastTouchTimestamp() const
int64_t
GetOrientation() const
For more information, see gvr_controller_state_get_orientation().
GetPosition() const
For more information, see gvr_controller_state_get_position().
GetRecentered() const
bool
For more information, see gvr_controller_state_get_recentered().
GetRecentering() const
bool
For more information, see gvr_controller_state_get_recentering().
GetTouchDown() const
bool
For more information, see gvr_controller_state_get_touch_down().
GetTouchPos() const
For more information, see gvr_controller_state_get_touch_pos().
GetTouchUp() const
bool
For more information, see gvr_controller_state_get_touch_up().
IsTouching() const
bool
For more information, see gvr_controller_state_is_touching().
Update(const ControllerApi & api)
void
For more information, see gvr_controller_state_update().
Update(const ControllerApi & api, int32_t controller_index)
void
For more information, see gvr_controller_state_update().

Public functions

ControllerState

 ControllerState()

GetAccel

gvr_vec3f GetAccel() const 

For more information, see gvr_controller_state_get_accel().

GetApiStatus

ControllerApiStatus GetApiStatus() const 

For more information, see gvr_controller_state_get_api_status().

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().

GetButtonState

bool GetButtonState(
  ControllerButton button
) const 

For more information, see gvr_controller_state_get_button_state().

GetButtonUp

bool GetButtonUp(
  ControllerButton button
) const 

For more information, see gvr_controller_state_get_button_up().

GetConnectionState

ControllerConnectionState GetConnectionState() const 

For more information, see gvr_controller_state_get_connection_state().

GetGyro

gvr_vec3f GetGyro() const 

For more information, see gvr_controller_state_get_gyro().

GetLastAccelTimestamp

int64_t GetLastAccelTimestamp() const 

GetLastBatteryTimestamp

int64_t GetLastBatteryTimestamp() const 

For more information, see gvr_controller_state_get_last_battery_timestamp.

GetLastButtonTimestamp

int64_t GetLastButtonTimestamp() const 

GetLastGyroTimestamp

int64_t GetLastGyroTimestamp() const 

GetLastOrientationTimestamp

int64_t GetLastOrientationTimestamp() const 

GetLastPositionTimestamp

int64_t GetLastPositionTimestamp() const 

GetLastTouchTimestamp

int64_t GetLastTouchTimestamp() const 

GetOrientation

gvr_quatf GetOrientation() const 

For more information, see gvr_controller_state_get_orientation().

GetPosition

gvr_vec3f GetPosition() const 

For more information, see gvr_controller_state_get_position().

GetRecentered

bool GetRecentered() const 

For more information, see gvr_controller_state_get_recentered().

GetRecentering

bool GetRecentering() const 

For more information, see gvr_controller_state_get_recentering().

GetTouchDown

bool GetTouchDown() const 

For more information, see gvr_controller_state_get_touch_down().

GetTouchPos

gvr_vec2f GetTouchPos() const 

For more information, see gvr_controller_state_get_touch_pos().

GetTouchUp

bool GetTouchUp() const 

For more information, see gvr_controller_state_get_touch_up().

IsTouching

bool IsTouching() const 

For more information, see gvr_controller_state_is_touching().

Update

void Update(
  const ControllerApi & api
)

For more information, see gvr_controller_state_update().

Update

void Update(
  const ControllerApi & api,
  int32_t controller_index
)

For more information, see gvr_controller_state_update().