hitTest

fun hitTest(xPx: Float, yPx: Float): List<HitResult>

Deprecated

Use collisionSystem.hitTest(xPx, yPx)

Replace with

collisionSystem.hitTest(xPx, yPx)

Tests to see if a ray starting from the screen/camera position is hitting any nodes within the scene and returns a list of HitTestResults containing all of the nodes that were hit, sorted by distance.

Specify the camera/screen/view position where the hit ray will start from in screen coordinates.

Return

PickHitResult list for each nodes that was hit sorted by distance. Empty if no nodes were hit.

Parameters

xPx

x view coordinate in pixels

yPx

y view coordinate in pixels


fun hitTest(motionEvent: MotionEvent): List<HitResult>

Deprecated

Use view.hitTest(motionEvent)

Replace with

collisionSystem.hitTest(motionEvent)

Tests to see if a ray starting from the screen/camera position is hitting any nodes within the scene and returns a list of HitTestResults containing all of the nodes that were hit, sorted by distance.

Specify the camera/screen/view position where the hit ray will start from in screen coordinates.

Return

PickHitResult list for each nodes that was hit sorted by distance. Empty if no nodes were hit.

Parameters

motionEvent

view motion event


Deprecated

Use collisionSystem.hitTest(ray)

Replace with

collisionSystem.hitTest(ray)

Tests to see if a ray is hitting any nodes within the scene and returns a list of HitTestResults containing all of the nodes that were hit, sorted by distance.

Return

PickHitResult list for each nodes that was hit sorted by distance. Empty if no nodes were hit.

Parameters

ray

The ray to use for the test.