MovableComponentTester


public final class MovableComponentTester


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

Summary

Public methods

boolean
equals(Object other)
int
final boolean

Whether this component is user-anchorable.

final boolean

Whether this component scales in Z.

final boolean

Whether this component is system-movable.

final void
triggerOnMoveEnd(
    @NonNull Ray finalInputRay,
    @NonNull Pose finalPose,
    @NonNull Vector3 finalScale,
    Entity updatedParent
)

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

final void
triggerOnMoveStart(
    @NonNull Ray initialInputRay,
    @NonNull Pose initialPose,
    @NonNull Vector3 initialScale,
    @NonNull Entity initialParent
)

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

final void
triggerOnMoveUpdate(
    @NonNull Ray currentInputRay,
    @NonNull Pose currentPose,
    @NonNull Vector3 currentScale
)

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

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

isAnchorable

Added in 1.0.0-alpha16
public final boolean isAnchorable()

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-alpha16
public final boolean isScaleInZ()

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-alpha16
public final boolean isSystemMovable()

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.

triggerOnMoveEnd

Added in 1.0.0-alpha16
public final void triggerOnMoveEnd(
    @NonNull Ray finalInputRay,
    @NonNull Pose finalPose,
    @NonNull Vector3 finalScale,
    Entity updatedParent
)

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

This triggers callbacks registered via MovableComponent.addMoveListener.

Parameters
@NonNull Ray finalInputRay

The final ray origin and direction in activity space.

@NonNull Pose finalPose

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

@NonNull Vector3 finalScale

The final scale of the entity.

Entity updatedParent

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-alpha16
public final void triggerOnMoveStart(
    @NonNull Ray initialInputRay,
    @NonNull Pose initialPose,
    @NonNull Vector3 initialScale,
    @NonNull Entity initialParent
)

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

This triggers callbacks registered via MovableComponent.addMoveListener.

Parameters
@NonNull Ray initialInputRay

The initial ray origin and direction in activity space.

@NonNull Pose initialPose

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

@NonNull Vector3 initialScale

The initial scale of the entity.

@NonNull Entity initialParent

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-alpha16
public final void triggerOnMoveUpdate(
    @NonNull Ray currentInputRay,
    @NonNull Pose currentPose,
    @NonNull Vector3 currentScale
)

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

This triggers callbacks registered via MovableComponent.addMoveListener.

Parameters
@NonNull Ray currentInputRay

The current ray origin and direction in activity space.

@NonNull Pose currentPose

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

@NonNull Vector3 currentScale

The current scale of the entity.

Throws
IllegalStateException

If triggerOnMoveStart has not been called.