Page Summary
-
Valueis a generic container for different pure value types, used to store property values retrieved usingProperties.get(). -
Each
Valueobject corresponds to a specific property and must be accessed using the correct type, as defined inProperties.PropertyType. -
Valueobjects can be converted into various data types such asint,float,long, andmat4fusing corresponding methods likeasInt(),asFloat(),asFlags(), andasMat4f(). -
It's recommended to reuse a single
Valueobject throughout the app's lifecycle to minimize allocations, and it's crucial to callclose()to destroy the value when finished. -
The
getFlags()method returns the flags for theValueitself (currently always 0), whileasFlags()retrieves property-specific flags for types likeTRACKING_STATUS.
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.