JxrPlatformAdapter.InputEvent


public class JxrPlatformAdapter.InputEvent


InputEvent for SceneCore Platform.

Summary

Nested types

Info about the hit result of the ray.

Constants

static final int

While the primary action button or gesture was held, the pointer was disabled.

static final int

The primary action button or gesture was just pressed / started.

static final int

The primary action button or gesture is not pressed, and the pointer ray started to hit a new node.

static final int

The primary action button or gesture is not pressed, and the pointer ray stopped hitting the node that it was previously hitting.

static final int

The primary action button or gesture is not pressed, and the pointer ray continued to hit the same node.

static final int

The primary action button or gesture was pressed/active in the previous event, and is still pressed/active.

static final int

The primary action button or gesture was just released / stopped.

static final int

Default pointer type for the source (no handedness).

static final int

Left hand / controller pointer.

static final int

Right hand / controller pointer.

static final int

Event is based on (one of) the user's controller(s).

static final int

Event is based on a mix of the head, eyes, and hands.

static final int

Event is based on one of the user's hands.

static final int

Event is based on the user's head.

static final int

Event is based on a 2D mouse pointing device.

static final int

Unknown source.

Public fields

int

Returns the current action associated with this input event.

@NonNull Vector3

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

@Nullable JxrPlatformAdapter.InputEvent.HitInfo

Info on the first entity (closest to the ray origin) that was hit by the input ray, if any.

@NonNull Vector3

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

int
@Nullable JxrPlatformAdapter.InputEvent.HitInfo

Info on the second entity for the same task that was hit by the input ray, if any.

int
long

The time this event occurred, in the android.os.SystemClock#uptimeMillis time base.

Public constructors

InputEvent(
    int source,
    int pointerType,
    long timestamp,
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    int action,
    @Nullable JxrPlatformAdapter.InputEvent.HitInfo hitInfo,
    @Nullable JxrPlatformAdapter.InputEvent.HitInfo secondaryHitInfo
)

Constants

ACTION_CANCEL

Added in 1.0.0-alpha01
public static final int ACTION_CANCEL = 3

While the primary action button or gesture was held, the pointer was disabled. This happens if you are using controllers and the battery runs out, or if you are using a source that transitions to a new pointer type, eg SOURCE_GAZE_AND_GESTURE.

ACTION_DOWN

Added in 1.0.0-alpha01
public static final int ACTION_DOWN = 0

The primary action button or gesture was just pressed / started.

ACTION_HOVER_ENTER

Added in 1.0.0-alpha01
public static final int ACTION_HOVER_ENTER = 5

The primary action button or gesture is not pressed, and the pointer ray started to hit a new node. The hit info represents the node that is being hit (may be null if pointer capture is enabled).

Hover input events are never provided for sensitive source types.

ACTION_HOVER_EXIT

Added in 1.0.0-alpha01
public static final int ACTION_HOVER_EXIT = 6

The primary action button or gesture is not pressed, and the pointer ray stopped hitting the node that it was previously hitting. The hit info represents the node that was being hit (may be null if pointer capture is enabled).

Hover input events are never provided for sensitive source types.

ACTION_HOVER_MOVE

Added in 1.0.0-alpha01
public static final int ACTION_HOVER_MOVE = 4

The primary action button or gesture is not pressed, and the pointer ray continued to hit the same node. The hit info represents the node that was hit (may be null if pointer capture is enabled).

Hover input events are never provided for sensitive source types.

ACTION_MOVE

Added in 1.0.0-alpha01
public static final int ACTION_MOVE = 2

The primary action button or gesture was pressed/active in the previous event, and is still pressed/active. The hit info represents the node that was originally hit (ie, as provided in the ACTION_DOWN event). The hit position may be null if the pointer is no longer hitting that node.

ACTION_UP

Added in 1.0.0-alpha01
public static final int ACTION_UP = 1

The primary action button or gesture was just released / stopped. The hit info represents the node that was originally hit (ie, as provided in the ACTION_DOWN event).

POINTER_TYPE_DEFAULT

Added in 1.0.0-alpha01
public static final int POINTER_TYPE_DEFAULT = 0

Default pointer type for the source (no handedness). Occurs for SOURCE_UNKNOWN, SOURCE_HEAD, SOURCE_MOUSE, and SOURCE_GAZE_AND_GESTURE.

POINTER_TYPE_LEFT

Added in 1.0.0-alpha01
public static final int POINTER_TYPE_LEFT = 1

Left hand / controller pointer. Occurs for SOURCE_CONTROLLER, SOURCE_HANDS, and SOURCE_GAZE_AND_GESTURE.

POINTER_TYPE_RIGHT

Added in 1.0.0-alpha01
public static final int POINTER_TYPE_RIGHT = 2

Right hand / controller pointer. Occurs for SOURCE_CONTROLLER, SOURCE_HANDS, and SOURCE_GAZE_AND_GESTURE.

SOURCE_CONTROLLER

Added in 1.0.0-alpha01
public static final int SOURCE_CONTROLLER = 2

Event is based on (one of) the user's controller(s). Ray origin and direction are for a controller aim pose as defined by OpenXR. (...) Action state is based on the primary button on the controller, usually the bottom-most face button.

SOURCE_GAZE_AND_GESTURE

Added in 1.0.0-alpha01
public static final int SOURCE_GAZE_AND_GESTURE = 5

Event is based on a mix of the head, eyes, and hands. Ray origin is at average between eyes and points in direction based on a mix of eye gaze direction and hand motion. During a two-handed zoom/rotate gesture, left/right pointer events will be issued; otherwise, default events are issued based on the gaze ray. Action state is based on if the user has done a pinch gesture or not.

Events from this source are considered sensitive and hover events are never sent.

SOURCE_HANDS

Added in 1.0.0-alpha01
public static final int SOURCE_HANDS = 3

Event is based on one of the user's hands. Ray is a hand aim pose, with origin between thumb and forefinger and points in direction based on hand orientation. Action state is based on a pinch gesture.

SOURCE_HEAD

Added in 1.0.0-alpha01
public static final int SOURCE_HEAD = 1

Event is based on the user's head. Ray origin is at average between eyes, pushed out to the near clipping plane for both eyes and points in direction head is facing. Action state is based on volume up button being depressed.

Events from this source are considered sensitive and hover events are never sent.

SOURCE_MOUSE

Added in 1.0.0-alpha01
public static final int SOURCE_MOUSE = 4

Event is based on a 2D mouse pointing device. Ray origin behaves the same as for DEVICE_TYPE_HEAD and points in direction based on mouse movement. During a drag, the ray origin moves approximating hand motion. The scrollwheel moves the ray away from / towards the user. Action state is based on the primary mouse button.

SOURCE_UNKNOWN

Added in 1.0.0-alpha01
public static final int SOURCE_UNKNOWN = 0

Unknown source.

Public fields

action

Added in 1.0.0-alpha01
public int action

Returns the current action associated with this input event.

direction

Added in 1.0.0-alpha01
public @NonNull Vector3 direction

A point indicating the direction the ray is pointing in, in the receiver's activity space. The ray is a vector starting at the origin point and passing through the direction point.

hitInfo

Added in 1.0.0-alpha01
public @Nullable JxrPlatformAdapter.InputEvent.HitInfo hitInfo

Info on the first entity (closest to the ray origin) that was hit by the input ray, if any. This info will be null if no Entity was hit.

origin

Added in 1.0.0-alpha01
public @NonNull Vector3 origin

The origin of the ray, in the receiver's activity space. Will be zero if the source is not ray-based (eg, direct touch).

pointerType

Added in 1.0.0-alpha01
public int pointerType

secondaryHitInfo

Added in 1.0.0-alpha01
public @Nullable JxrPlatformAdapter.InputEvent.HitInfo secondaryHitInfo

Info on the second entity for the same task that was hit by the input ray, if any.

source

Added in 1.0.0-alpha01
public int source

timestamp

Added in 1.0.0-alpha01
public long timestamp

The time this event occurred, in the android.os.SystemClock#uptimeMillis time base.

Public constructors

InputEvent

Added in 1.0.0-alpha01
public InputEvent(
    int source,
    int pointerType,
    long timestamp,
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    int action,
    @Nullable JxrPlatformAdapter.InputEvent.HitInfo hitInfo,
    @Nullable JxrPlatformAdapter.InputEvent.HitInfo secondaryHitInfo
)