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.

Value

public final class Value

A generic container for various pure value types. Each Value is for a specific property, retrieved by get(int, Value). Each Value must be retrieved as the correct type, which are documented in Properties.PropertyType.

Public Constructors

Value()
Creates a new, unpopulated, value.

Public Methods

long
asFlags()
Converts this value into flags.
float
asFloat()
Converts this value into a float.
int
asInt()
Converts this value into an int.
void
asMat4f(float[] outTransform)
Converts this value into a mat4 (represented by a float[16]).
void
close()
Destroys the value.
long
getFlags()
Returns the value's flags; always 0 for now.

Inherited Methods

Public Constructors

public Value ()

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

Public Methods

public long asFlags ()

Converts this value into flags.

Throws
IllegalStateException if this value is the wrong type.

public float asFloat ()

Converts this value into a float.

Throws
IllegalStateException if this value is the wrong type.

public int asInt ()

Converts this value into an int.

Throws
IllegalStateException if this value is the wrong type.

public void asMat4f (float[] outTransform)

Converts this value into a mat4 (represented by a float[16]).

Parameters
outTransform the float[16] to write the result. Must not be null.
Throws
IllegalStateException if this value is the wrong type.

public void close ()

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

public long getFlags ()

Returns the value's flags; always 0 for now. Note that this is different from asFlags(). This method returns the flags for the Value and is valid for any Value type; asFlags() returns the flags for properties such as TRACKING_STATUS.