FakeRuntimePlane


public final class FakeRuntimePlane


Test-only implementation of RuntimePlane

The properties of the FakeRuntimePlane can be set manually in order to simulate a runtime plane in the environment.

For example, for a FakeRuntimePlane with Label.WALL, Type.VERTICAL and TrackingState.PAUSED:

val plane = FakeRuntimePlane(type = RuntimePlane.Type.VERTICAL,
label = RuntimePlane.Label.WALL,
trackingState = TrackingState.PAUSED)

And to modify the properties during the test:

plane.apply {
trackingState = TrackingState.TRACKING
centerPose = Pose(Vector3(1f, 2f, 3f), Quaternion(0f, 0f, 0f, 1f))
}

Summary

Public constructors

FakeRuntimePlane(
    @NonNull Plane.Type type,
    @NonNull Plane.Label label,
    @NonNull TrackingState trackingState,
    @NonNull Pose centerPose,
    @NonNull Vector2 extents,
    @NonNull List<@NonNull Vector2> vertices,
    Plane subsumedBy,
    @NonNull Collection<@NonNull Anchor> anchors
)

Public methods

@NonNull Anchor

Creates a new FakeRuntimeAnchor and adds it to the anchors property.

void

Removes the given anchor from the anchors property.

final @NonNull Collection<@NonNull Anchor>

The anchors that are attached to this plane.

@NonNull Pose

The center of the detected plane.

@NonNull Vector2

The dimensions of the detected plane.

@NonNull Plane.Label
Plane

If this plane has been subsumed, returns the plane this plane was merged into.

@NonNull TrackingState

The TrackingState of this trackable.

@NonNull Plane.Type

The Type of the plane

@NonNull List<@NonNull Vector2>

Returns the 2D vertices (three or more) of a convex polygon approximating the detected plane.

void
setCenterPose(@NonNull Pose centerPose)

The center of the detected plane.

void

The dimensions of the detected plane.

void
setSubsumedBy(Plane subsumedBy)

If this plane has been subsumed, returns the plane this plane was merged into.

void

The TrackingState of this trackable.

void

Returns the 2D vertices (three or more) of a convex polygon approximating the detected plane.

Public constructors

FakeRuntimePlane

Added in 1.0.0-alpha05
public FakeRuntimePlane(
    @NonNull Plane.Type type,
    @NonNull Plane.Label label,
    @NonNull TrackingState trackingState,
    @NonNull Pose centerPose,
    @NonNull Vector2 extents,
    @NonNull List<@NonNull Vector2> vertices,
    Plane subsumedBy,
    @NonNull Collection<@NonNull Anchor> anchors
)

Public methods

createAnchor

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

Creates a new FakeRuntimeAnchor and adds it to the anchors property.

detachAnchor

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

Removes the given anchor from the anchors property.

getAnchors

Added in 1.0.0-alpha05
public final @NonNull Collection<@NonNull AnchorgetAnchors()

The anchors that are attached to this plane.

getCenterPose

Added in 1.0.0-alpha05
public @NonNull Pose getCenterPose()

The center of the detected plane.

getExtents

Added in 1.0.0-alpha05
public @NonNull Vector2 getExtents()

The dimensions of the detected plane.

getLabel

Added in 1.0.0-alpha05
public @NonNull Plane.Label getLabel()

getSubsumedBy

Added in 1.0.0-alpha05
public Plane getSubsumedBy()

If this plane has been subsumed, returns the plane this plane was merged into.

getTrackingState

Added in 1.0.0-alpha05
public @NonNull TrackingState getTrackingState()

The TrackingState of this trackable.

getType

Added in 1.0.0-alpha05
public @NonNull Plane.Type getType()

The Type of the plane

getVertices

Added in 1.0.0-alpha05
public @NonNull List<@NonNull Vector2getVertices()

Returns the 2D vertices (three or more) of a convex polygon approximating the detected plane.

setCenterPose

Added in 1.0.0-alpha05
public void setCenterPose(@NonNull Pose centerPose)

The center of the detected plane.

setExtents

Added in 1.0.0-alpha05
public void setExtents(@NonNull Vector2 extents)

The dimensions of the detected plane.

setSubsumedBy

Added in 1.0.0-alpha05
public void setSubsumedBy(Plane subsumedBy)

If this plane has been subsumed, returns the plane this plane was merged into.

setTrackingState

Added in 1.0.0-alpha05
public void setTrackingState(@NonNull TrackingState trackingState)

The TrackingState of this trackable.

setVertices

Added in 1.0.0-alpha05
public void setVertices(@NonNull List<@NonNull Vector2> vertices)

Returns the 2D vertices (three or more) of a convex polygon approximating the detected plane.