MovableComponentTester


class MovableComponentTester


A test-only accessor for MovableComponent that enables direct manipulation and inspection of its internal state.

Summary

Public functions

open operator Boolean
equals(other: Any?)
open Int
Unit
triggerOnMoveEnd(
    finalInputRay: Ray,
    finalPose: Pose,
    finalScale: Vector3,
    updatedParent: Entity?
)

Simulates the end of a move event from the runtime, notifying all registered listeners.

Unit
triggerOnMoveStart(
    initialInputRay: Ray,
    initialPose: Pose,
    initialScale: Vector3,
    initialParent: Entity
)

Simulates the start of a move event from the runtime, notifying all registered listeners.

Unit
triggerOnMoveUpdate(
    currentInputRay: Ray,
    currentPose: Pose,
    currentScale: Vector3
)

Simulates an update to an ongoing move event from the runtime, notifying all registered listeners.

Public properties

Boolean

Whether this component is user-anchorable.

Boolean

Whether this component scales in Z.

Boolean

Whether this component is system-movable.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

triggerOnMoveEnd

Added in 1.0.0-rc01
fun triggerOnMoveEnd(
    finalInputRay: Ray,
    finalPose: Pose,
    finalScale: Vector3,
    updatedParent: Entity? = null
): Unit

Simulates the end of a move event from the runtime, notifying all registered listeners.

This triggers callbacks registered via MovableComponent.addMoveListener.

Parameters
finalInputRay: Ray

The final ray origin and direction in activity space.

finalPose: Pose

The final pose of the entity, relative to its parent.

finalScale: Vector3

The final scale of the entity.

updatedParent: Entity? = null

The updated parent of the entity if it was changed during the move.

Throws
IllegalStateException

If triggerOnMoveStart has not been called.

triggerOnMoveStart

Added in 1.0.0-rc01
fun triggerOnMoveStart(
    initialInputRay: Ray,
    initialPose: Pose,
    initialScale: Vector3,
    initialParent: Entity
): Unit

Simulates the start of a move event from the runtime, notifying all registered listeners.

This triggers callbacks registered via MovableComponent.addMoveListener.

Parameters
initialInputRay: Ray

The initial ray origin and direction in activity space.

initialPose: Pose

The initial pose of the entity, relative to its parent.

initialScale: Vector3

The initial scale of the entity.

initialParent: Entity

The parent of the entity at the start of the move.

Throws
IllegalStateException

If a move is already in progress.

triggerOnMoveUpdate

Added in 1.0.0-rc01
fun triggerOnMoveUpdate(
    currentInputRay: Ray,
    currentPose: Pose,
    currentScale: Vector3
): Unit

Simulates an update to an ongoing move event from the runtime, notifying all registered listeners.

This triggers callbacks registered via MovableComponent.addMoveListener.

Parameters
currentInputRay: Ray

The current ray origin and direction in activity space.

currentPose: Pose

The current pose of the entity, relative to its parent.

currentScale: Vector3

The current scale of the entity.

Throws
IllegalStateException

If triggerOnMoveStart has not been called.

Public properties

isAnchorable

Added in 1.0.0-rc01
val isAnchorable: Boolean

Whether this component is user-anchorable.

This is set to true when created via MovableComponent.createAnchorable, and false otherwise.

isScaleInZ

Added in 1.0.0-rc01
val isScaleInZ: Boolean

Whether this component scales in Z.

This corresponds to the scaleInZ parameter used in MovableComponent.createCustomMovable or MovableComponent.createSystemMovable. It is always false when created via MovableComponent.createAnchorable.

isSystemMovable

Added in 1.0.0-rc01
val isSystemMovable: Boolean

Whether this component is system-movable.

This is set to true when created via MovableComponent.createSystemMovable or MovableComponent.createAnchorable, and false when created via MovableComponent.createCustomMovable.