Result = RayCast(x, y, z, DestinationX, DestinationY, DestinationZ, PickMask)
Casts a ray between the first point and the second point, 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().


x, y, z The first point coordinates, in world unit.
DestinationX, DestinationY, DestinationZ The second point coordinates, in world unit.
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 -1 if the ray has collided with any object.

See Also

NormalX(), NormalY(), NormalZ()

Supported OS


<- PointPick() - Engine3D Index - RayCollide() ->