class Depth


Depth information corresponding to a specific RenderViewpoint.

The availability of depth data depends on the DepthEstimationMode. Depth Maps can include smooth, DepthEstimationMode.SMOOTH_ONLY, raw, DepthEstimationMode.RAW_ONLY, or both, DepthEstimationMode.SMOOTH_AND_RAW, postprocessing options depending on the runtime.

This also allows depth to be turned off by setting it to DepthEstimationMode.DISABLED.

The mode is set in a Session.config that is passed to Session.configure.

Update frequency and the dimensions of the maps provided are system-defined. The buffer lifecycles are controlled by the runtime so if the data will not be used upon receiving, a copy should be made.

OpenXr does not support DepthEstimationMode.SMOOTH_AND_RAW.

Summary

Nested types

Contains the current state of depth tracking.

Public companion functions

Depth
left(session: Session)

Returns the Depth data associated with the left display.

Depth
mono(session: Session)

Returns the Depth associated with the single device display.

Depth
right(session: Session)

Returns the Depth data associated with the right display.

Public functions

open String

Returns a string representation of Depth for debugging.

Public properties

StateFlow<Depth.State>

the current State of the depth data

Public companion functions

left

Added in 1.0.0-beta02
fun left(session: Session): Depth

Returns the Depth data associated with the left display.

Parameters
session: Session

the currently active Session

mono

Added in 1.0.0-beta02
fun mono(session: Session): Depth

Returns the Depth associated with the single device display.

Parameters
session: Session

the currently active Session

Throws
IllegalStateException

if Session.config has DepthEstimationMode set to DISABLED or if device does not support androidx.xr.runtime.RenderingMode.MONO

right

Added in 1.0.0-beta02
fun right(session: Session): Depth

Returns the Depth data associated with the right display.

Parameters
session: Session

the currently active Session

Public functions

toString

open fun toString(): String

Returns a string representation of Depth for debugging.

Note: Not intended for production use.

Public properties

state

Added in 1.0.0-beta02
val stateStateFlow<Depth.State>

the current State of the depth data