public final 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 methods

boolean
equals(Object other)
final Pose

the Pose of the physical camera in the world space

final Pose

the Pose of the virtual camera in the world space

final HardwareBuffer

the HardwareBuffer of the frame captured by the session

final Matrix4

the projection Matrix4 of the camera

final @NonNull ComparableTimeMark

the time at which the state was computed

final @NonNull TrackingState

the TrackingState of the camera

final Function1<@NonNull FloatBuffer, @NonNull FloatBuffer>

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

final Matrix4

the view Matrix4 of the camera

int

Public methods

equals

public boolean equals(Object other)

getCameraPose

Added in 1.0.0-alpha14
public final Pose getCameraPose()

the Pose of the physical camera in the world space

getDisplayOrientedPose

Added in 1.0.0-alpha14
public final Pose getDisplayOrientedPose()

the Pose of the virtual camera in the world space

getHardwareBuffer

Added in 1.0.0-alpha14
public final HardwareBuffer getHardwareBuffer()

the HardwareBuffer of the frame captured by the session

getProjectionMatrix

Added in 1.0.0-alpha14
public final Matrix4 getProjectionMatrix()

the projection Matrix4 of the camera

getTimeMark

Added in 1.0.0-alpha14
public final @NonNull ComparableTimeMark getTimeMark()

the time at which the state was computed

getTrackingState

Added in 1.0.0-alpha14
public final @NonNull TrackingState getTrackingState()

the TrackingState of the camera

getTransformCoordinates2D

Added in 1.0.0-alpha14
public final Function1<@NonNull FloatBuffer, @NonNull FloatBuffergetTransformCoordinates2D()

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

getViewMatrix

Added in 1.0.0-alpha14
public final Matrix4 getViewMatrix()

the view Matrix4 of the camera

hashCode

public int hashCode()