FakeActivitySpace


class FakeActivitySpace : FakeSystemSpaceEntity


Test-only implementation of ActivitySpace

Summary

Public constructors

Public functions

open Unit

Adds a listener to be called when the bounds of the primary Activity change.

open ListenableFuture<HitTestResult>
hitTestRelativeToActivityPose(
    origin: Vector3,
    direction: Vector3,
    hitTestFilter: Int,
    activityPose: ActivityPose
)

Creates a hit test at the from the specified origin in the specified direction into the scene.

open Unit

Removes a listener to be called when the bounds of the primary Activity change.

Public properties

open Dimensions

Returns the bounds of this ActivitySpace.

Public constructors

FakeActivitySpace

Added in 1.0.0-alpha04
FakeActivitySpace()

Public functions

addOnBoundsChangedListener

Added in 1.0.0-alpha04
open fun addOnBoundsChangedListener(
    listener: ActivitySpace.OnBoundsChangedListener
): Unit

Adds a listener to be called when the bounds of the primary Activity change. If the same listener is added multiple times, it will only fire each event on time.

Parameters
listener: ActivitySpace.OnBoundsChangedListener

The listener to register.

hitTestRelativeToActivityPose

Added in 1.0.0-alpha04
open fun hitTestRelativeToActivityPose(
    origin: Vector3,
    direction: Vector3,
    hitTestFilter: Int,
    activityPose: ActivityPose
): ListenableFuture<HitTestResult>

Creates a hit test at the from the specified origin in the specified direction into the scene.

Parameters
origin: Vector3

The translation of the origin of the hit test relative to this ActivityPose.

direction: Vector3

The direction for the hit test ray from the ActivityPose.

hitTestFilter: Int

The scenes that will be in range for the hit test.

activityPose: ActivityPose

The ActivityPose to hit test against.

Returns
ListenableFuture<HitTestResult>

a {@code ListenableFuture}. The HitResult describes if it hit something and where relative to the given ActivityPose. Listeners will be called on the main thread if Runnable::run is supplied.

removeOnBoundsChangedListener

Added in 1.0.0-alpha04
open fun removeOnBoundsChangedListener(
    listener: ActivitySpace.OnBoundsChangedListener
): Unit

Removes a listener to be called when the bounds of the primary Activity change. If the given listener was not added, this call does nothing.

Parameters
listener: ActivitySpace.OnBoundsChangedListener

The listener to unregister.

Public properties

bounds

Added in 1.0.0-alpha04
open val boundsDimensions

Returns the bounds of this ActivitySpace.