JxrPlatformAdapter.InputEvent


class JxrPlatformAdapter.InputEvent


InputEvent for SceneCore Platform.

Summary

Nested types

Info about the hit result of the ray.

Constants

const Int

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

const Int

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

const Int

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

const Int

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

const Int

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

const Int

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

const Int

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

const Int

Default pointer type for the source (no handedness).

const Int

Left hand / controller pointer.

const Int

Right hand / controller pointer.

const Int

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

const Int

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

const Int

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

const Int

Event is based on the user's head.

const Int

Event is based on a 2D mouse pointing device.

const Int

Unknown source.

Public constructors

InputEvent(
    source: Int,
    pointerType: Int,
    timestamp: Long,
    origin: Vector3,
    direction: Vector3,
    action: Int,
    hitInfo: JxrPlatformAdapter.InputEvent.HitInfo?,
    secondaryHitInfo: JxrPlatformAdapter.InputEvent.HitInfo?
)

Public properties

Int

Returns the current action associated with this input event.

Vector3

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

JxrPlatformAdapter.InputEvent.HitInfo?

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

Vector3

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

Int
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.

Constants

ACTION_CANCEL

Added in 1.0.0-alpha01
const val ACTION_CANCEL = 3: Int

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
const val ACTION_DOWN = 0: Int

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

ACTION_HOVER_ENTER

Added in 1.0.0-alpha01
const val ACTION_HOVER_ENTER = 5: Int

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
const val ACTION_HOVER_EXIT = 6: Int

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
const val ACTION_HOVER_MOVE = 4: Int

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
const val ACTION_MOVE = 2: Int

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
const val ACTION_UP = 1: Int

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
const val POINTER_TYPE_DEFAULT = 0: Int

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
const val POINTER_TYPE_LEFT = 1: Int

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

POINTER_TYPE_RIGHT

Added in 1.0.0-alpha01
const val POINTER_TYPE_RIGHT = 2: Int

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

SOURCE_CONTROLLER

Added in 1.0.0-alpha01
const val SOURCE_CONTROLLER = 2: Int

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
const val SOURCE_GAZE_AND_GESTURE = 5: Int

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
const val SOURCE_HANDS = 3: Int

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
const val SOURCE_HEAD = 1: Int

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
const val SOURCE_MOUSE = 4: Int

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
const val SOURCE_UNKNOWN = 0: Int

Unknown source.

Public constructors

InputEvent

Added in 1.0.0-alpha01
InputEvent(
    source: Int,
    pointerType: Int,
    timestamp: Long,
    origin: Vector3,
    direction: Vector3,
    action: Int,
    hitInfo: JxrPlatformAdapter.InputEvent.HitInfo?,
    secondaryHitInfo: JxrPlatformAdapter.InputEvent.HitInfo?
)

Public properties

action

Added in 1.0.0-alpha01
val actionInt

Returns the current action associated with this input event.

direction

Added in 1.0.0-alpha01
val directionVector3

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
val hitInfoJxrPlatformAdapter.InputEvent.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
val originVector3

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
val pointerTypeInt

secondaryHitInfo

Added in 1.0.0-alpha01
val secondaryHitInfoJxrPlatformAdapter.InputEvent.HitInfo?

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
val sourceInt

timestamp

Added in 1.0.0-alpha01
val timestampLong

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