RenderViewpoint


public final class RenderViewpoint


Represents a single viewpoint used for rendering, such as a left eye, right eye, or a mono view.

This class provides access to the State of a specific render viewpoint, including its pose, localPose, and fieldOfView.

Summary

Nested types

public final class RenderViewpoint.State

Class that contains the current state of the render viewpoint.

Public methods

boolean
equals(Object other)
final @NonNull StateFlow<@NonNull RenderViewpoint.State>

the current State of the render viewpoint

int
static final @NonNull RenderViewpoint
left(@NonNull Session session)

Returns the RenderViewpoint associated with the left display.

static final @NonNull RenderViewpoint
mono(@NonNull Session session)

Returns the RenderViewpoint associated with the single device display.

static final @NonNull RenderViewpoint
right(@NonNull Session session)

Returns the RenderViewpoint associated with the right display.

Public methods

equals

public boolean equals(Object other)

getState

Added in 1.0.0-alpha15
public final @NonNull StateFlow<@NonNull RenderViewpoint.StategetState()

the current State of the render viewpoint

hashCode

public int hashCode()

left

Added in 1.0.0-alpha15
public static final @NonNull RenderViewpoint left(@NonNull Session session)

Returns the RenderViewpoint associated with the left display.

Parameters
@NonNull Session session

the currently active Session

Throws
IllegalStateException

if the device does not support androidx.xr.runtime.RenderingMode.STEREO

mono

Added in 1.0.0-alpha15
public static final @NonNull RenderViewpoint mono(@NonNull Session session)

Returns the RenderViewpoint associated with the single device display.

When the device supports androidx.xr.runtime.RenderingMode.MONO, this will return the render viewpoint for that display. When the device uses androidx.xr.runtime.RenderingMode.STEREO, this will return the render viewpoint for the center of the two displays.

Parameters
@NonNull Session session

the currently active Session

right

Added in 1.0.0-alpha15
public static final @NonNull RenderViewpoint right(@NonNull Session session)

Returns the RenderViewpoint associated with the right display.

Parameters
@NonNull Session session

the currently active Session

Throws
IllegalStateException

if the device does not support androidx.xr.runtime.RenderingMode.STEREO