World:rayCast
Casts a ray and calls a function for each fixtures it intersects.
World:rayCast( x1, y1, x2, y2, callback )
x1 number The x position of the starting point of the ray.
y1 number The x position of the starting point of the ray.
x2 number The x position of the end point of the ray.
y2 number The x value of the surface normal vector of the shape edge.
callback function A function called for each fixture intersected by the ray. The function gets six arguments and should return a number as a control value. The intersection points fed into the function will be in an arbitrary order. If you wish to find the closest point of intersection, you'll need to do that yourself within the function. The easiest way to do that is by using the fraction value.