timelinefx:timelinefx.tlQuadTree.RayCast
Method RayCast:Int( px:Float, py:Float, d:tlVector2, maxdistance:Float=0, Data:@object, onFoundObject:Void( @object,@object,tlCollisionResult ), Layer:Int[] )
Query a quadtree with a ray of given length This will query the quadtree with a raycast and perform a callback on the first object hit by the ray with a function pointer you pass
Parameters
px x coordinate of the starting point of the ray
py y coordinate of the starting point of the ray
d tlVector2 describing the direction of the raycast
maxdistance The maximum distance of the ray cast, or 0 for infinite
onFoundObject A function pointer to function where you can perform whatever tasks you need to with the objects found.
Layer Array of layers in the quadtree that you want to search