Corona physics function 'findNextObject'

local object, x, y = findNextObject(startFrom, directionX, directionY)

startFrom is a display object
directionX & directionY is a direction where to search for the next object

returns:
object - First visible display object in the given direction, nil if it isn't found
x, y - position where is found the object

* startFrom and object are physical objects

I need this function to show shadow of the ball which is bouncing from not flat area ( not signle rectangle, something like array of lines ). If i have this function, i will put ball object and direction of the rays and i will know where to show shadow and how to rotate and scale it. It is posible to improvise something like this, but it would be too slow.
This function can be findNextObjec(startX, startY, directionX, directionY) or you can implement both functions.

views:1804 update:2011/9/17 18:17:57
corona forums © 2003-2011