MouseRayCast()

Syntax

Result = MouseRayCast(#Camera, x, y, PickMask)
Description
Casts a ray from the 2D point through the scene, and checks if an object is crossing the ray. This function doesn't rely on the physic engine. The normals value at the impact point are available with NormalX(), NormalY() and NormalZ().

Parameters

#Camera The camera to use.
x, y The coordinates, in pixels, of the point.
PickMask The entity mask used while performing the ray cast. Only the entities with a mask matching the PickMask value will be reported. If this parameter is omitted, all the entities are valid for the ray detection. The mask can be a combination, to select more than one entity group. To have more information about pick mask, see CreateEntity().

Return value

Returns non-zero if the ray has collided with any object.

See Also

NormalX(), NormalY(), NormalZ()

Supported OS

All

<- MousePick() - Engine3D Index - NextWorldCollision() ->