pick

fun View.pick(xPx: Float, yPx: Float, handler: Any = Looper.getMainLooper(), onCompleted: (Entity, 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.

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.