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.

GvrPointerScrollInput

This class is used by GvrPointerInputModule to route scroll events through Unity's event system.

Summary

It maintains indepedent velocities for each instance of IScrollHandler that is currently being scrolled. Inertia can optionally be toggled off.

Public attributes

PROPERTY_NAME_DECELERATION_RATE = "decelerationRate"
const string
Property name for accessing deceleration rate.
PROPERTY_NAME_INERTIA = "inertia"
const string
Property name for accessing inertia.
SCROLL_DELTA_MULTIPLIER = 1000.0f
const float
Multiplier for calculating the scroll delta.
decelerationRate = 0.05f
float
The deceleration rate is the speed reduction per second.
inertia = true
bool
Inertia means that scroll events will continue for a while after the user stops touching the touchpad.

Public functions

HandleScroll(GameObject currentGameObject, PointerEventData pointerData, GvrBasePointer pointer, IGvrEventExecutor eventExecutor)
void
Performs scrolling if the user is touching the controller's touchpad.

Public attributes

PROPERTY_NAME_DECELERATION_RATE

const string PROPERTY_NAME_DECELERATION_RATE = "decelerationRate"

Property name for accessing deceleration rate.

PROPERTY_NAME_INERTIA

const string PROPERTY_NAME_INERTIA = "inertia"

Property name for accessing inertia.

SCROLL_DELTA_MULTIPLIER

const float SCROLL_DELTA_MULTIPLIER = 1000.0f

Multiplier for calculating the scroll delta.

Used so that the scroll delta is within the order of magnitude that the UI system expects.

decelerationRate

float decelerationRate = 0.05f

The deceleration rate is the speed reduction per second.

A value of 0.5 halves the speed each second. The default is 0.05. The deceleration rate is only used when inertia is true.

inertia

bool inertia = true

Inertia means that scroll events will continue for a while after the user stops touching the touchpad.

It gradually slows down according to the decelerationRate.

Public functions

HandleScroll

void HandleScroll(
  GameObject currentGameObject,
  PointerEventData pointerData,
  GvrBasePointer pointer,
  IGvrEventExecutor eventExecutor
)

Performs scrolling if the user is touching the controller's touchpad.

Scroll speed is dependent upon touch position.

Details
Parameters
currentGameObject
The game object having the IScrollHandler component.
pointerData
The pointer event data.
pointer
The pointer object.
eventExecutor
The executor to use to process the event.