FakeRuntimePlane


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(
    type: Plane.Type,
    label: Plane.Label,
    trackingState: TrackingState,
    centerPose: Pose,
    extents: Vector2,
    vertices: List<Vector2>,
    subsumedBy: Plane?,
    anchors: MutableCollection<Anchor>
)

Public functions

open Anchor

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

open Unit

Removes the given anchor from the anchors property.

Public properties

MutableCollection<Anchor>

The anchors that are attached to this plane.

open Pose

The center of the detected plane.

open Vector2

The dimensions of the detected plane.

open Plane.Label
open Plane?

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

open TrackingState

The TrackingState of this trackable.

open Plane.Type

The Type of the plane

open List<Vector2>

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

Public constructors

FakeRuntimePlane

Added in 1.0.0-alpha05
FakeRuntimePlane(
    type: Plane.Type = RuntimePlane.Type.HORIZONTAL_UPWARD_FACING,
    label: Plane.Label = RuntimePlane.Label.FLOOR,
    trackingState: TrackingState = TrackingState.TRACKING,
    centerPose: Pose = Pose(),
    extents: Vector2 = Vector2.Zero,
    vertices: List<Vector2> = emptyList(),
    subsumedBy: Plane? = null,
    anchors: MutableCollection<Anchor> = mutableListOf()
)

Public functions

createAnchor

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

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

detachAnchor

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

Removes the given anchor from the anchors property.

Public properties

anchors

Added in 1.0.0-alpha05
val anchorsMutableCollection<Anchor>

The anchors that are attached to this plane.

centerPose

Added in 1.0.0-alpha05
open var centerPosePose

The center of the detected plane.

extents

Added in 1.0.0-alpha05
open var extentsVector2

The dimensions of the detected plane.

label

Added in 1.0.0-alpha05
open val labelPlane.Label

subsumedBy

Added in 1.0.0-alpha05
open var subsumedByPlane?

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

trackingState

Added in 1.0.0-alpha05
open var trackingStateTrackingState

The TrackingState of this trackable.

type

Added in 1.0.0-alpha05
open val typePlane.Type

The Type of the plane

vertices

Added in 1.0.0-alpha05
open var verticesList<Vector2>

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