FakePerceptionManager


class FakePerceptionManager


Test-only implementation of androidx.xr.arcore.runtime.PerceptionManager used to validate state transitions.

Summary

Public constructors

Public functions

Unit
addHitResult(hitResult: HitResult)

Adds a androidx.xr.arcore.runtime.HitResult to the list that is returned when calling hitTest with any pose.

Unit
addTrackable(trackable: Trackable)

Adds a androidx.xr.arcore.runtime.Trackable to the list that is returned when calling trackables.

Unit

Removes all androidx.xr.arcore.runtime.HitResult instances passed to addHitResult.

Unit

Removes all androidx.xr.arcore.runtime.Trackable instances passed to addTrackable.

open Anchor

Defines a tracked location in the physical world.

open Unit

Detaches the given androidx.xr.arcore.runtime.Anchor from this trackable.

open List<UUID>

Retrieves all the UUID instances from Anchor objects that have been persisted.

open MutableList<HitResult>
hitTest(ray: Ray)

Performs a ray cast in the direction of the given ray in the latest camera view.

open Anchor

Loads an Anchor from local storage.

open Anchor

Loads an Anchor from a native pointer.

open Unit

Deletes a persisted Anchor from local storage.

Public properties

MutableList<Anchor>

List of anchors created by this FakePerceptionManager.

Boolean

Flag to represent available tracking state of the camera.

open DepthMap?

Left DepthMap's current frame information

open Hand?

Hand tracking information for the left Hand.

open DepthMap?

Mono DepthMap's current frame information

open DepthMap?

Right DepthMap's current frame information

open Hand?

Hand tracking information for the right Hand.

open MutableList<Trackable>

Returns the list of all known trackables.

Public constructors

FakePerceptionManager

Added in 1.0.0-alpha07
FakePerceptionManager()

Public functions

addHitResult

Added in 1.0.0-alpha07
fun addHitResult(hitResult: HitResult): Unit

Adds a androidx.xr.arcore.runtime.HitResult to the list that is returned when calling hitTest with any pose.

addTrackable

Added in 1.0.0-alpha07
fun addTrackable(trackable: Trackable): Unit

Adds a androidx.xr.arcore.runtime.Trackable to the list that is returned when calling trackables.

clearHitResults

Added in 1.0.0-alpha07
fun clearHitResults(): Unit

Removes all androidx.xr.arcore.runtime.HitResult instances passed to addHitResult.

clearTrackables

Added in 1.0.0-alpha07
fun clearTrackables(): Unit

Removes all androidx.xr.arcore.runtime.Trackable instances passed to addTrackable.

createAnchor

Added in 1.0.0-alpha07
open fun createAnchor(pose: Pose): Anchor

Defines a tracked location in the physical world.

detachAnchor

Added in 1.0.0-alpha07
open fun detachAnchor(anchor: Anchor): Unit

Detaches the given androidx.xr.arcore.runtime.Anchor from this trackable. Single androidx.xr.arcore.runtime.Anchor instances rely on this function to remove themselves from the AnchorHolder.

getPersistedAnchorUuids

Added in 1.0.0-alpha07
open fun getPersistedAnchorUuids(): List<UUID>

Retrieves all the UUID instances from Anchor objects that have been persisted.

hitTest

Added in 1.0.0-alpha07
open fun hitTest(ray: Ray): MutableList<HitResult>

Performs a ray cast in the direction of the given ray in the latest camera view.

loadAnchor

Added in 1.0.0-alpha07
open fun loadAnchor(uuid: UUID): Anchor

Loads an Anchor from local storage.

loadAnchorFromNativePointer

Added in 1.0.0-alpha07
open fun loadAnchorFromNativePointer(nativePointer: Long): Anchor

Loads an Anchor from a native pointer.

unpersistAnchor

Added in 1.0.0-alpha07
open fun unpersistAnchor(uuid: UUID): Unit

Deletes a persisted Anchor from local storage.

Public properties

anchors

Added in 1.0.0-alpha07
val anchorsMutableList<Anchor>

List of anchors created by this FakePerceptionManager.

isTrackingAvailable

Added in 1.0.0-alpha07
var isTrackingAvailableBoolean

Flag to represent available tracking state of the camera.

leftDepthMap

Added in 1.0.0-alpha07
open val leftDepthMapDepthMap?

Left DepthMap's current frame information

leftHand

Added in 1.0.0-alpha07
open val leftHandHand?

Hand tracking information for the left Hand. Only available on supported platforms.

monoDepthMap

Added in 1.0.0-alpha07
open val monoDepthMapDepthMap?

Mono DepthMap's current frame information

rightDepthMap

Added in 1.0.0-alpha07
open val rightDepthMapDepthMap?

Right DepthMap's current frame information

rightHand

Added in 1.0.0-alpha07
open val rightHandHand?

Hand tracking information for the right Hand. Only available on supported platforms.

trackables

Added in 1.0.0-alpha07
open val trackablesMutableList<Trackable>

Returns the list of all known trackables.