FakeXrExtensions.FakeNode


class FakeXrExtensions.FakeNode : Parcelable


A fake implementation of the XR extensions Node.

Summary

Public functions

Int
Float
IBinder?
Float
EnvironmentToken?

This function is deprecated.

This method is no longer supported.

Executor?
GltfModelToken?

This function is deprecated.

This method is no longer supported.

Consumer<InputEvent!>?
String?
FakeXrExtensions.FakeNode?
Consumer<Int!>?
ReformOptions?
SurfaceControlViewHost.SurfacePackage?
Executor?
Consumer<NodeTransform!>?
Float
Float
Float
Float
Float
Float
Float
Boolean
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

Fires the InputEvent callback with the given event.

Unit

Fires the nodeTransform callback with the given transform.

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-alpha02
fun describeContents(): Int

getAlpha

Added in 1.0.0-alpha02
fun getAlpha(): Float

getAnchorId

Added in 1.0.0-alpha02
fun getAnchorId(): IBinder?

getCornerRadius

Added in 1.0.0-alpha02
fun getCornerRadius(): Float

getEnvironment

Added in 1.0.0-alpha02
Deprecated in 1.0.0-alpha02
fun getEnvironment(): EnvironmentToken?

getExecutor

Added in 1.0.0-alpha02
fun getExecutor(): Executor?

getGltfModel

Added in 1.0.0-alpha02
Deprecated in 1.0.0-alpha02
fun getGltfModel(): GltfModelToken?

getListener

Added in 1.0.0-alpha02
fun getListener(): Consumer<InputEvent!>?

getName

Added in 1.0.0-alpha02
fun getName(): String?

getParent

Added in 1.0.0-alpha02
fun getParent(): FakeXrExtensions.FakeNode?

getPointerCaptureStateCallback

Added in 1.0.0-alpha02
fun getPointerCaptureStateCallback(): Consumer<Int!>?

getReformOptions

Added in 1.0.0-alpha02
fun getReformOptions(): ReformOptions?

getTransformExecutor

Added in 1.0.0-alpha02
fun getTransformExecutor(): Executor?

getTransformListener

Added in 1.0.0-alpha02
fun getTransformListener(): Consumer<NodeTransform!>?

getWOrientation

Added in 1.0.0-alpha02
fun getWOrientation(): Float

getXOrientation

Added in 1.0.0-alpha02
fun getXOrientation(): Float

getXPosition

Added in 1.0.0-alpha02
fun getXPosition(): Float

getYOrientation

Added in 1.0.0-alpha02
fun getYOrientation(): Float

getYPosition

Added in 1.0.0-alpha02
fun getYPosition(): Float

getZOrientation

Added in 1.0.0-alpha02
fun getZOrientation(): Float

getZPosition

Added in 1.0.0-alpha02
fun getZPosition(): Float

isVisible

Added in 1.0.0-alpha02
fun isVisible(): Boolean

listenForInput

Added in 1.0.0-alpha02
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-alpha02
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-alpha02
fun sendInputEvent(event: InputEvent): Unit

Fires the InputEvent callback with the given event. It is invoked on the executor provided in listenForInput.

sendTransformEvent

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

Fires the nodeTransform callback with the given transform. It is invoked on the executor provided in listenForInput.

setNonPointerFocusTarget

Added in 1.0.0-alpha02
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-alpha02
fun stopListeningForInput(): Unit

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

stopPointerCapture

Added in 1.0.0-alpha02
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-alpha02
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-alpha02
fun writeToParcel(in: Parcel, flags: Int): Unit