pickNode

fun View.pickNode(xPx: Float, yPx: Float, nodes: List<Node>, handler: Any = Looper.getMainLooper(), onCompleted: (node: Node?, depth: Float, fragCoords: Float3) -> Unit)

Creates a picking query. Multiple queries can be created (e.g.: multi-touch).

Picking queries are all executed when Renderer.render is called on this View. The provided callback is guaranteed to be called at some point in the future.

Typically it takes a couple frames to receive the result of a picking query.

Parameters

xPx

Horizontal screen coordinate in pixels where you want to pick. (0 = left, View Width = right) The x value is negative when the point is left of the View.getViewport, between 0 and the width of the View.getViewport width when the point is within the viewport, and greater than the width when the point is to the right of the viewport.

yPx

Vertical screen coordinate in pixels where you want to pick. (0 = top, View Height = bottom) The y value is negative when the point is above the View.getViewport, between 0 and the height of the View.getViewport height when the point is within the viewport, and greater than the height when the point is below the viewport.

nodes

List of nodes you want the pick to be made on.

handler

An java.util.concurrent.Executor. On Android this can also be a android.os.Handler.

onCompleted

User callback executed by handler when the picking query result is available.


fun View.pickNode(motionEvent: MotionEvent, nodes: List<Node>, handler: Any = Looper.getMainLooper(), onCompleted: (node: Node?, depth: Float, fragCoords: Float3) -> Unit)

Creates a picking query. Multiple queries can be created (e.g.: multi-touch).

Picking queries are all executed when Renderer.render is called on this View. The provided callback is guaranteed to be called at some point in the future.

Typically it takes a couple frames to receive the result of a picking query.

Parameters

motionEvent

The motion event where you want to pick.

nodes

List of nodes you want the pick to be made on.

handler

An java.util.concurrent.Executor. On Android this can also be a android.os.Handler.

onCompleted

User callback executed by handler when the picking query result is available.


fun View.pickNode(viewPosition: Float2, nodes: List<Node>, handler: Any = Looper.getMainLooper(), onCompleted: (node: Node?, depth: Float, fragCoords: Float3) -> Unit)

Creates a picking query. Multiple queries can be created (e.g.: multi-touch).

Picking queries are all executed when Renderer.render is called on this View. The provided callback is guaranteed to be called at some point in the future.

Typically it takes a couple frames to receive the result of a picking query.

Parameters

viewPosition

normalized view coordinate x = (0 = left, 0.5 = center, 1 = right) y = (0 = bottom, 0.5 = center, 1 = top)

nodes

List of nodes you want the pick to be made on.

handler

An java.util.concurrent.Executor. On Android this can also be a android.os.Handler.

onCompleted

User callback executed by handler when the picking query result is available.