November 6, 2019 update:
  • There's a new open source Cardboard SDK for iOS and Android NDK that offers a streamlined API, improved device compatibility, and built-in viewer profile QR code scanning. A corresponding Unity package (SDK) is planned for a future release. We recommend that all developers actively building for Google Cardboard migrate (iOS, Android NDK) to the new Cardboard SDK.
October 15, 2019 update:
  • The Daydream View VR headset is no longer available for purchase. However, you can continue to use the existing Google VR SDK to update and distribute your apps to the Google Play Store, and make them available to users in the Daydream app.

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.