lua.wetgenes.chipmunk.space.query_point_nearest
item = space:query_point_nearest(x,y,d,group,categories,mask)
Find the nearest shape that is within d distance from the point at x,y. Use group,categories and mask to filter the results.
returns a table with the following info or nil for no hit
it.shape -- the shape
it.point_x -- the point of contact (x)
it.point_y -- the point of contact (y)
it.distance -- the distance to the point of contact
it.gradient_x -- the normalised vector to collision (x)
it.gradient_y -- the normalised vector to collision (y)