public final class InputEvent


Defines input events for SceneCore.

Summary

Nested types

public final class InputEvent.Action

Specifies the action (e.g. down, up, move, etc.) of the input event.

public final class InputEvent.HitInfo

Information about the hit result of the input ray, originating from one of the InputEvent.Source, and intersecting with some Entity on the scene.

public final class InputEvent.Pointer

Specifies the pointer type (e.g. left, right or default) of the input event.

public final class InputEvent.Source

Specifies the source (e.g. hands, controller, head) of the input event.

Public constructors

InputEvent(
    @NonNull InputEvent.Source source,
    @NonNull InputEvent.Pointer pointerType,
    long timestamp,
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    @NonNull InputEvent.Action action,
    @NonNull List<@NonNull InputEvent.HitInfo> hitInfoList
)

Public methods

boolean
equals(Object other)
final @NonNull InputEvent.Action

Actions similar to Android's MotionEvent for keeping track of a sequence of events on the same target, e.g., HOVER_ENTER -> HOVER_MOVE -> HOVER_EXIT, DOWN -> MOVE -> UP.

final @NonNull Vector3

A point indicating the direction the ray is pointing, in the receiver's activity space.

final @NonNull List<@NonNull InputEvent.HitInfo>

List of HitInfo for the scene entities from the same task that were hit by the input ray, if any.

final @NonNull Vector3

The origin of the ray in the receiver's activity space.

final @NonNull InputEvent.Pointer

Type of the individual pointer (e.g. left, right or default) for this event.

final @NonNull InputEvent.Source

Type of source (e.g. hands, controller, head) that generated this event.

final long

Timestamp from SystemClock.uptimeMillis time base.

int

Public constructors

InputEvent

Added in 1.0.0-alpha09
public InputEvent(
    @NonNull InputEvent.Source source,
    @NonNull InputEvent.Pointer pointerType,
    long timestamp,
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    @NonNull InputEvent.Action action,
    @NonNull List<@NonNull InputEvent.HitInfo> hitInfoList
)
Parameters
@NonNull InputEvent.Source source

Type of source (e.g. hands, controller, head) that generated this event.

@NonNull InputEvent.Pointer pointerType

Type of the individual pointer (e.g. left, right or default) for this event.

long timestamp

Timestamp from SystemClock.uptimeMillis time base.

@NonNull Vector3 origin

The origin of the ray in the receiver's activity space.

@NonNull Vector3 direction

A point indicating the direction the ray is pointing, in the receiver's activity space.

@NonNull InputEvent.Action action

Actions similar to Android's MotionEvent for keeping track of a sequence of events on the same target, e.g., HOVER_ENTER -> HOVER_MOVE -> HOVER_EXIT, DOWN -> MOVE -> UP.

@NonNull List<@NonNull InputEvent.HitInfo> hitInfoList

List of HitInfo for the scene entities from the same task that were hit by the input ray, if any. The list is sorted from closest to farthest from the ray origin. Note that this first hit entity remains the same during an ongoing DOWN -> MOVE -> UP action, even if the pointer stops hitting the entity during the action.

Public methods

equals

public boolean equals(Object other)

getAction

Added in 1.0.0-alpha09
public final @NonNull InputEvent.Action getAction()

Actions similar to Android's MotionEvent for keeping track of a sequence of events on the same target, e.g., HOVER_ENTER -> HOVER_MOVE -> HOVER_EXIT, DOWN -> MOVE -> UP.

getDirection

Added in 1.0.0-alpha09
public final @NonNull Vector3 getDirection()

A point indicating the direction the ray is pointing, in the receiver's activity space.

getHitInfoList

Added in 1.0.0-alpha09
public final @NonNull List<@NonNull InputEvent.HitInfogetHitInfoList()

List of HitInfo for the scene entities from the same task that were hit by the input ray, if any. The list is sorted from closest to farthest from the ray origin. Note that this first hit entity remains the same during an ongoing DOWN -> MOVE -> UP action, even if the pointer stops hitting the entity during the action.

getOrigin

Added in 1.0.0-alpha09
public final @NonNull Vector3 getOrigin()

The origin of the ray in the receiver's activity space.

getPointerType

Added in 1.0.0-alpha09
public final @NonNull InputEvent.Pointer getPointerType()

Type of the individual pointer (e.g. left, right or default) for this event.

getSource

Added in 1.0.0-alpha09
public final @NonNull InputEvent.Source getSource()

Type of source (e.g. hands, controller, head) that generated this event.

getTimestamp

Added in 1.0.0-alpha09
public final long getTimestamp()

Timestamp from SystemClock.uptimeMillis time base.

hashCode

public int hashCode()