Page Summary
-
The
Eventclass is a container for various Google VR events that client applications can respond to. -
It provides methods to access event details like type, timestamp, and recentering information if applicable.
-
Developers should reuse a single
Eventobject throughout the app's lifecycle for better performance. -
The
close()method must be called when the event is no longer needed to release resources. -
Events can indicate recentering, providing details about the type of recentering and transform information.
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 void getRecenterEventStartSpaceFromTrackingSpaceTransform (float[] outTransform)
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.