FakeXrExtensions.FakeNode


class FakeXrExtensions.FakeNode : Parcelable


A fake implementation of the XR extensions Node.

Summary

Public functions

Int
Unit
listenForInput(listener: Consumer<InputEvent!>, executor: Executor)

Begins listening for 6DOF input events on this Node, and any descendant Nodes that do not have their own event listener set.

Unit
requestPointerCapture(stateCallback: Consumer<Int!>, executor: Executor)

Requests pointer capture.

Unit
Unit
Unit

Sets the focus target for non-pointer input (eg, keyboard events) when this Node is clicked.

Unit

Removes the listener for 6DOF input events from this Node.

Unit

Disables previously-requested pointer capture on this node.

Closeable
subscribeToTransform(
    transformCallback: Consumer<NodeTransform!>,
    executor: Executor
)

Subscribes to the transform of this node, relative to the OpenXR reference space used as world space for the shared scene.

Unit
writeToParcel(in: Parcel, flags: Int)

Public functions

describeContents

Added in 1.0.0-alpha01
fun describeContents(): Int

listenForInput

Added in 1.0.0-alpha01
fun listenForInput(listener: Consumer<InputEvent!>, executor: Executor): Unit

Begins listening for 6DOF input events on this Node, and any descendant Nodes that do not have their own event listener set. The event listener is called on the provided Executor. Calling this method replaces any existing event listener for this node.

requestPointerCapture

Added in 1.0.0-alpha01
fun requestPointerCapture(stateCallback: Consumer<Int!>, executor: Executor): Unit

Requests pointer capture. All XR input events that hit this node or any of its children are delivered as normal; any other input events that would otherwise be dispatched elsewhere will instead be delivered to the input queue of this node (without hit info).

The stateCallback is called immediately with the current state of this pointer capture. Whenever this node is visible and a descendant of a task that is not bounded (is in FSM or overlay space), pointer capture will be active; otherwise it will be paused.

If pointer capture is explicitly stopped by a new call to requestPointerCapture() on the same node, or by a call to stopPointerCapture(), POINTER_CAPTURE_STATE_STOPPED is passed (and the stateCallback will not be called subsequently; also, the app can be sure that no more captured pointer events will be delivered based on that request). This also occurs if the node is destroyed without explicitly stopping pointer capture, or if a new call to requestPointerCapture() is made on the same node without stopping the previous request.

If there are multiple pointer capture requests (eg from other apps) that could be active at the same time, the most recently requested one is activated; all other requests stay paused.

There can only be a single request per Node. If a new requestPointerCapture() call is made on the same node without stopping the previous pointer capture request, the previous request is automatically stopped.

Parameters
stateCallback: Consumer<Int!>

a callback that will be called when pointer capture state changes.

executor: Executor

the executor the callback will be called on.

sendInputEvent

Added in 1.0.0-alpha01
fun sendInputEvent(event: InputEvent): Unit

sendTransformEvent

Added in 1.0.0-alpha01
fun sendTransformEvent(nodeTransform: FakeXrExtensions.FakeNodeTransform): Unit

setNonPointerFocusTarget

Added in 1.0.0-alpha01
fun setNonPointerFocusTarget(focusTarget: AttachedSurfaceControl): Unit

Sets the focus target for non-pointer input (eg, keyboard events) when this Node is clicked. The new target is the focusTarget's underlying View Root.

stopListeningForInput

Added in 1.0.0-alpha01
fun stopListeningForInput(): Unit

Removes the listener for 6DOF input events from this Node.

stopPointerCapture

Added in 1.0.0-alpha01
fun stopPointerCapture(): Unit

Disables previously-requested pointer capture on this node. The stateCallback callback will be called with POINTER_CAPTURE_STOPPED.

subscribeToTransform

Added in 1.0.0-alpha01
fun subscribeToTransform(
    transformCallback: Consumer<NodeTransform!>,
    executor: Executor
): Closeable

Subscribes to the transform of this node, relative to the OpenXR reference space used as world space for the shared scene. See XrExtensions.getOpenXrWorldSpaceType(). The provided matrix transforms a point in this node's local coordinate system into a point in world space coordinates. For example, NodeTransform.getTransform() * (0, 0, 0, 1) is the position of this node in world space. The first non-null transform will be returned immediately after the subscription set-up is complete. Note that the returned closeable must be closed by calling close() to prevent wasting system resources associated with the subscription.

Parameters
transformCallback: Consumer<NodeTransform!>

a callback that will be called when this node's transform changes.

executor: Executor

the executor the callback will be called on.

Returns
Closeable

a Closeable that must be used to cancel the subscription by calling close().

writeToParcel

Added in 1.0.0-alpha01
fun writeToParcel(in: Parcel, flags: Int): Unit

Public properties

alpha

Added in 1.0.0-alpha01
val alphaFloat

anchorId

Added in 1.0.0-alpha01
val anchorIdIBinder!

environment

Added in 1.0.0-alpha01
Deprecated in 1.0.0-alpha01
val environmentEnvironmentToken!

executor

Added in 1.0.0-alpha01
val executorExecutor!

gltfModel

Added in 1.0.0-alpha01
Deprecated in 1.0.0-alpha01
val gltfModelGltfModelToken!

isVisible

Added in 1.0.0-alpha01
val isVisibleBoolean

listener

Added in 1.0.0-alpha01
val listenerConsumer<InputEvent!>!

name

Added in 1.0.0-alpha01
val nameString!

pointerCaptureStateCallback

Added in 1.0.0-alpha01
val pointerCaptureStateCallbackConsumer<Int!>!

reformOptions

Added in 1.0.0-alpha01
val reformOptionsReformOptions!

transformExecutor

Added in 1.0.0-alpha01
val transformExecutorExecutor!

transformListener

Added in 1.0.0-alpha01
val transformListenerConsumer<NodeTransform!>!

wOrientation

Added in 1.0.0-alpha01
val wOrientationFloat

xOrientation

Added in 1.0.0-alpha01
val xOrientationFloat

xPosition

Added in 1.0.0-alpha01
val xPositionFloat

yOrientation

Added in 1.0.0-alpha01
val yOrientationFloat

yPosition

Added in 1.0.0-alpha01
val yPositionFloat

zOrientation

Added in 1.0.0-alpha01
val zOrientationFloat

zPosition

Added in 1.0.0-alpha01
val zPositionFloat