class CameraState


Represents the state of the device camera at a specific point in time.

Can be obtained from CoreState.cameraState provided by the androidx.xr.runtime.Session.

import androidx.xr.arcore.playservices.CameraState
import androidx.xr.arcore.playservices.cameraState

val coreState = session.state.value
val cameraState = coreState.cameraState
// The CameraState object is not supported by all runtimes;
// if it's not supported, `cameraState` will return null.
return cameraState?.hardwareBuffer

Summary

Public functions

open operator Boolean
equals(other: Any?)
open Int

Public properties

Pose?

the Pose of the physical camera in the world space

Pose?

the Pose of the virtual camera in the world space

HardwareBuffer?

the HardwareBuffer of the frame captured by the session

Matrix4?

the projection Matrix4 of the camera

ComparableTimeMark

the time at which the state was computed

TrackingState

the TrackingState of the camera

((FloatBuffer) -> FloatBuffer)?

a function that transforms coordinates from normalized OpenGL device coordinates to normalized texture coordinates

Matrix4?

the view Matrix4 of the camera

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

cameraPose

Added in 1.0.0-alpha14
val cameraPosePose?

the Pose of the physical camera in the world space

displayOrientedPose

Added in 1.0.0-alpha14
val displayOrientedPosePose?

the Pose of the virtual camera in the world space

hardwareBuffer

Added in 1.0.0-alpha14
@RequiresApi(value = 27)
val hardwareBufferHardwareBuffer?

the HardwareBuffer of the frame captured by the session

projectionMatrix

Added in 1.0.0-alpha14
val projectionMatrixMatrix4?

the projection Matrix4 of the camera

timeMark

Added in 1.0.0-alpha14
val timeMarkComparableTimeMark

the time at which the state was computed

trackingState

Added in 1.0.0-alpha14
val trackingStateTrackingState

the TrackingState of the camera

transformCoordinates2D

Added in 1.0.0-alpha14
val transformCoordinates2D: ((FloatBuffer) -> FloatBuffer)?

a function that transforms coordinates from normalized OpenGL device coordinates to normalized texture coordinates

viewMatrix

Added in 1.0.0-alpha14
val viewMatrixMatrix4?

the view Matrix4 of the camera