FakeRuntimePlane


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

Public functions

open Anchor

Creates a new FakeRuntimeAnchor and adds it to anchors.

open Unit

Removes the given anchor from anchors.

Public properties

MutableCollection<Anchor>

list of the FakeRuntimeAnchors that are attached to the plane

open Pose

the center of the detected plane

open FloatSize2d

the dimensions of the detected plane

open Plane.Label

the Label of the plane

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>

the Vector2 vertices of a convex polygon approximating the detected plane

Public constructors

FakeRuntimePlane

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

Public functions

createAnchor

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

Creates a new FakeRuntimeAnchor and adds it to anchors.

detachAnchor

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

Removes the given anchor from anchors.

Public properties

anchors

Added in 1.0.0-alpha12
val anchorsMutableCollection<Anchor>

list of the FakeRuntimeAnchors that are attached to the plane

centerPose

Added in 1.0.0-alpha12
open var centerPosePose

the center of the detected plane

extents

Added in 1.0.0-alpha12
open var extentsFloatSize2d

the dimensions of the detected plane

label

Added in 1.0.0-alpha12
open val labelPlane.Label

the Label of the plane

subsumedBy

Added in 1.0.0-alpha12
open var subsumedByPlane?

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

trackingState

Added in 1.0.0-alpha12
open var trackingStateTrackingState

the TrackingState of this trackable

type

Added in 1.0.0-alpha12
open val typePlane.Type

the Type of the plane

vertices

Added in 1.0.0-alpha12
open var verticesList<Vector2>

the Vector2 vertices of a convex polygon approximating the detected plane