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.

Event

public final class Event

Container for various GVR-events to which the client can optionally respond.

Nested Classes

class Event.EventType Constants that represent the type of an Event. 
class Event.RecenterType Constants that represent the type of recentering. 

Public Constructors

Event()
Creates a new, unpopulated, event.

Public Methods

void
close()
Destroys the event.
long
getFlags()
Returns the event flags; always 0 for now.
long
getRecenterEventFlags()
Returns the event flags; always 0 for now.
void
getRecenterEventStartSpaceFromTrackingSpaceTransform(float[] outTransform)
Returns the transform to start space from tracking space.
int
getRecenterEventType()
Returns the type of recentering (a constant in Event.RecenterType).
long
getTimestamp()
Returns the event's timestamp, in nanos.
int
getType()
Returns the type of the event (one of the entries in Event.EventType).

Inherited Methods

Public Constructors

public Event ()

Creates a new, unpopulated, event. This event may be reused for multiple calls to pollEvent(Event). It's recommended to have one Event object for the lifetime of the app to reduce allocations.

Public Methods

public void close ()

Destroys the event. Must be called when done with the event.

public long getFlags ()

Returns the event flags; always 0 for now.

public long getRecenterEventFlags ()

Returns the event flags; always 0 for now. Only valid ifgetType() returns RECENTER.

Throws
IllegalStateException if this isn't a RECENTER event.

public void getRecenterEventStartSpaceFromTrackingSpaceTransform (float[] outTransform)

Returns the transform to start space from tracking space. Only valid if getType() returns RECENTER.

Parameters
outTransform
Throws
IllegalStateException if this isn't a RECENTER event.

public int getRecenterEventType ()

Returns the type of recentering (a constant in Event.RecenterType). Only valid if getType() returns RECENTER.

Throws
IllegalStateException if this isn't a RECENTER event.

public long getTimestamp ()

Returns the event's timestamp, in nanos.

public int getType ()

Returns the type of the event (one of the entries in Event.EventType).