FakePerceptionManager


public final class FakePerceptionManager


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

Summary

Public constructors

Public methods

final void

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

final void

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

final void

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

final void

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

@NonNull Anchor

Defines a tracked location in the physical world.

void

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

final @NonNull List<@NonNull Anchor>

List of anchors created by this FakePerceptionManager.

DepthMap

Left androidx.xr.arcore.internal.DepthMap's current frame information

Hand

Hand tracking information for the left androidx.xr.arcore.internal.Hand.

DepthMap

Mono androidx.xr.arcore.internal.DepthMap's current frame information

@NonNull List<@NonNull UUID>

Retrieves all the java.util.UUID instances from androidx.xr.arcore.internal.Anchor objects that have been persisted.

DepthMap

Right androidx.xr.arcore.internal.DepthMap's current frame information

Hand

Hand tracking information for the right androidx.xr.arcore.internal.Hand.

@NonNull List<@NonNull Trackable>

Returns the list of all known trackables.

@NonNull List<@NonNull HitResult>

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

final boolean

Flag to represent available tracking state of the camera.

@NonNull Anchor

Loads an androidx.xr.arcore.internal.Anchor from local storage.

@NonNull Anchor
loadAnchorFromNativePointer(long nativePointer)

Loads an androidx.xr.arcore.internal.Anchor from a native pointer.

final void
setTrackingAvailable(boolean isTrackingAvailable)

Flag to represent available tracking state of the camera.

void

Deletes a persisted androidx.xr.arcore.internal.Anchor from local storage.

Public constructors

FakePerceptionManager

Added in 1.0.0-alpha06
public FakePerceptionManager()

Public methods

addHitResult

Added in 1.0.0-alpha06
public final void addHitResult(@NonNull HitResult hitResult)

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

addTrackable

Added in 1.0.0-alpha06
public final void addTrackable(@NonNull Trackable trackable)

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

clearHitResults

Added in 1.0.0-alpha06
public final void clearHitResults()

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

clearTrackables

Added in 1.0.0-alpha06
public final void clearTrackables()

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

createAnchor

Added in 1.0.0-alpha06
public @NonNull Anchor createAnchor(@NonNull Pose pose)

Defines a tracked location in the physical world.

detachAnchor

Added in 1.0.0-alpha06
public void detachAnchor(@NonNull Anchor anchor)

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

getAnchors

Added in 1.0.0-alpha06
public final @NonNull List<@NonNull AnchorgetAnchors()

List of anchors created by this FakePerceptionManager.

getLeftDepthMap

Added in 1.0.0-alpha06
public DepthMap getLeftDepthMap()

Left androidx.xr.arcore.internal.DepthMap's current frame information

getLeftHand

Added in 1.0.0-alpha06
public Hand getLeftHand()

Hand tracking information for the left androidx.xr.arcore.internal.Hand. Only available on supported platforms.

getMonoDepthMap

Added in 1.0.0-alpha06
public DepthMap getMonoDepthMap()

Mono androidx.xr.arcore.internal.DepthMap's current frame information

getPersistedAnchorUuids

Added in 1.0.0-alpha06
public @NonNull List<@NonNull UUIDgetPersistedAnchorUuids()

Retrieves all the java.util.UUID instances from androidx.xr.arcore.internal.Anchor objects that have been persisted.

getRightDepthMap

Added in 1.0.0-alpha06
public DepthMap getRightDepthMap()

Right androidx.xr.arcore.internal.DepthMap's current frame information

getRightHand

Added in 1.0.0-alpha06
public Hand getRightHand()

Hand tracking information for the right androidx.xr.arcore.internal.Hand. Only available on supported platforms.

getTrackables

Added in 1.0.0-alpha06
public @NonNull List<@NonNull TrackablegetTrackables()

Returns the list of all known trackables.

hitTest

Added in 1.0.0-alpha06
public @NonNull List<@NonNull HitResulthitTest(@NonNull Ray ray)

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

isTrackingAvailable

Added in 1.0.0-alpha06
public final boolean isTrackingAvailable()

Flag to represent available tracking state of the camera.

loadAnchor

Added in 1.0.0-alpha06
public @NonNull Anchor loadAnchor(@NonNull UUID uuid)

Loads an androidx.xr.arcore.internal.Anchor from local storage.

loadAnchorFromNativePointer

Added in 1.0.0-alpha06
public @NonNull Anchor loadAnchorFromNativePointer(long nativePointer)

Loads an androidx.xr.arcore.internal.Anchor from a native pointer.

setTrackingAvailable

Added in 1.0.0-alpha06
public final void setTrackingAvailable(boolean isTrackingAvailable)

Flag to represent available tracking state of the camera.

unpersistAnchor

Added in 1.0.0-alpha06
public void unpersistAnchor(@NonNull UUID uuid)

Deletes a persisted androidx.xr.arcore.internal.Anchor from local storage.