FakePerceptionManager


public final class FakePerceptionManager


Fake implementation of PerceptionManager used to validate state transitions.

Summary

Public constructors

Public methods

final void

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

final void

Adds a Trackable to the list that is returned when calling trackables.

final void

Removes all HitResult instances passed to addHitResult.

final void

Removes all Trackable instances passed to addTrackable.

@NonNull Anchor

Defines a tracked location in the physical world.

void

Detaches the given Anchor from this trackable.

final @NonNull List<@NonNull Anchor>

a MutableList of FakeRuntimeAnchors created

DepthMap

the left DepthMap as a FakeRuntimeDepthMap

Hand

the left Hand as a FakeRuntimeHand

DepthMap

the mono DepthMap as a FakeRuntimeDepthMap

@NonNull List<@NonNull UUID>

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

DepthMap

the right DepthMap as a FakeRuntimeDepthMap

Hand

the right Hand as a FakeRuntimeHand

@NonNull List<@NonNull Trackable>

the Collection 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

a flag to represent available tracking state of the camera

@NonNull Anchor

Loads an Anchor from local storage.

final void
setTrackingAvailable(boolean value)

a flag to represent available tracking state of the camera

void

Deletes a persisted Anchor from local storage.

Public constructors

FakePerceptionManager

Added in 1.0.0-alpha12
public FakePerceptionManager()

Public methods

addHitResult

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

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

Parameters
@NonNull HitResult hitResult

the HitResult to add

addTrackable

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

Adds a Trackable to the list that is returned when calling trackables.

Parameters
@NonNull Trackable trackable

the Trackable to add

clearHitResults

Added in 1.0.0-alpha12
public final void clearHitResults()

Removes all HitResult instances passed to addHitResult.

clearTrackables

Added in 1.0.0-alpha12
public final void clearTrackables()

Removes all Trackable instances passed to addTrackable.

createAnchor

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

Defines a tracked location in the physical world.

Parameters
@NonNull Pose pose

the Pose of the anchor

Returns
@NonNull Anchor

the created Anchor

detachAnchor

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

Detaches the given Anchor from this trackable.

Single Anchor instances rely on this function to remove themselves from the AnchorHolder.

Parameters
@NonNull Anchor anchor

the Anchor to detach

getAnchors

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

a MutableList of FakeRuntimeAnchors created

getLeftDepthMap

Added in 1.0.0-alpha12
public DepthMap getLeftDepthMap()

the left DepthMap as a FakeRuntimeDepthMap

getLeftHand

Added in 1.0.0-alpha12
public Hand getLeftHand()

the left Hand as a FakeRuntimeHand

getMonoDepthMap

Added in 1.0.0-alpha12
public DepthMap getMonoDepthMap()

the mono DepthMap as a FakeRuntimeDepthMap

getPersistedAnchorUuids

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

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

Returns
@NonNull List<@NonNull UUID>

a list of UUIDs

getRightDepthMap

Added in 1.0.0-alpha12
public DepthMap getRightDepthMap()

the right DepthMap as a FakeRuntimeDepthMap

getRightHand

Added in 1.0.0-alpha12
public Hand getRightHand()

the right Hand as a FakeRuntimeHand

getTrackables

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

the Collection of all known Trackables

hitTest

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

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

Parameters
@NonNull Ray ray

the Ray to cast

Returns
@NonNull List<@NonNull HitResult>

a list of HitResult objects

isTrackingAvailable

Added in 1.0.0-alpha12
public final boolean isTrackingAvailable()

a flag to represent available tracking state of the camera

loadAnchor

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

Loads an Anchor from local storage.

Parameters
@NonNull UUID uuid

the UUID of the anchor to load

Returns
@NonNull Anchor

the loaded Anchor

setTrackingAvailable

Added in 1.0.0-alpha12
public final void setTrackingAvailable(boolean value)

a flag to represent available tracking state of the camera

unpersistAnchor

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

Deletes a persisted Anchor from local storage.

Parameters
@NonNull UUID uuid

the UUID of the anchor to unpersist