DarkBASIC Professional Help File

DX11 PICK OBJECT

Checks whether the specified object is intersected by a ray going into the screen from the given
2D screen position.
If it is, this function will return the distance from the main camera's near plane to the point on the object where the
intersection occured. The DX11 GET PICK VECTOR X(), DX11 GET PICK VECTOR Y() and DX11 GET PICK VECTOR Z()
functions can be used to get the world space position at which this intersection happened.

Syntax

    Return Float = DX11 PICK OBJECT(object, screenX, screenY)

Parameters

    object

> Dword
> The object to check whether it lies under the given screen coordinates or not.

    screenX

> Integer
> The (2D) X screen coordinate.

    screenY

> Integer
> The (2D) Y screen coordinate.

Returns

The distance from the main (screen) camera's near plane to the point of intersection with the specified object, or 0.0 if there was no intersection.

See also

OBJECT Functions Menu
DX11 Function Categories