API reference
API reference
Select your platform
No SDKs available
No versions available

OVRMetric Class

Modifiers: final
Pairs an OVRMetricDefinition with a value supplier function. The getValue lambda is called by the OVRMetricsFeature each frame to sample the current metric value for display in the OVR Metrics overlay. Create instances and add them to an OVRMetricsGroup for registration.

Signature

data class OVRMetric(val definition: OVRMetricDefinition, val getValue: () -> Int)

Constructors

OVRMetric ( definition , getValue )
Signature
constructor(definition: OVRMetricDefinition, getValue: () -> Int)
Parameters
definition: OVRMetricDefinition  Metadata describing this metric's name, display properties, value range, and graph/stat visibility settings. See OVRMetricDefinition.
getValue: Function0  Lambda function invoked each frame to sample the current integer value for this metric. Should be lightweight to avoid frame budget impact.
Returns
OVRMetric

Properties

definition : OVRMetricDefinition
[Get]
Metadata describing this metric's name, display properties, value range, and graph/stat visibility settings. See OVRMetricDefinition.
Signature
val definition: OVRMetricDefinition
getValue : Function0
[Get]
Lambda function invoked each frame to sample the current integer value for this metric. Should be lightweight to avoid frame budget impact.
Signature
val getValue: () -> Int

Methods

getName ()
Returns the display-friendly name of this metric by delegating to the underlying com_meta_spatial_ovrmetrics_ovrmetricdefinition. Used by the OVR Metrics overlay to label this metric's graph and readout.
Signature
fun getName(): String
Returns
String