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.