FakeRuntimePlane


public final class FakeRuntimePlane


Fake implementation of Plane.

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 FloatSize2d 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 anchors.

void

Removes the given anchor from anchors.

final @NonNull Collection<@NonNull Anchor>

list of the FakeRuntimeAnchors that are attached to the plane

@NonNull Pose

the center of the detected plane

@NonNull FloatSize2d

the dimensions of the detected plane

@NonNull Plane.Label

the Label of the plane

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>

the Vector2 vertices of a convex polygon approximating the detected plane

void

the center of the detected plane

void

the dimensions of the detected plane

void

if this plane has been subsumed, returns the plane this plane was merged into

void

the TrackingState of this trackable

void

the Vector2 vertices of a convex polygon approximating the detected plane

Public constructors

FakeRuntimePlane

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

Public methods

createAnchor

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

Creates a new FakeRuntimeAnchor and adds it to anchors.

detachAnchor

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

Removes the given anchor from anchors.

getAnchors

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

list of the FakeRuntimeAnchors that are attached to the plane

getCenterPose

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

the center of the detected plane

getExtents

Added in 1.0.0-alpha12
public @NonNull FloatSize2d getExtents()

the dimensions of the detected plane

getLabel

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

the Label of the plane

getSubsumedBy

Added in 1.0.0-alpha12
public Plane getSubsumedBy()

if this plane has been subsumed, returns the plane this plane was merged into

getTrackingState

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

the TrackingState of this trackable

getType

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

the Type of the plane

getVertices

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

the Vector2 vertices of a convex polygon approximating the detected plane

setCenterPose

Added in 1.0.0-alpha12
public void setCenterPose(@NonNull Pose value)

the center of the detected plane

setExtents

Added in 1.0.0-alpha12
public void setExtents(@NonNull FloatSize2d value)

the dimensions of the detected plane

setSubsumedBy

Added in 1.0.0-alpha12
public void setSubsumedBy(Plane value)

if this plane has been subsumed, returns the plane this plane was merged into

setTrackingState

Added in 1.0.0-alpha12
public void setTrackingState(@NonNull TrackingState value)

the TrackingState of this trackable

setVertices

Added in 1.0.0-alpha12
public void setVertices(@NonNull List<@NonNull Vector2> value)

the Vector2 vertices of a convex polygon approximating the detected plane