01 - A ray between two points
castTo(startX, startY, endX, endY, options)
Casts a ray from (startX, startY) to (endX, endY) and returns the nearest object or tile that blocks it as a RayHit.
pointXandpointY: the point where the ray stopped.distance: the distance traveled along the ray.normalXandnormalY: the normal of the surface that was hit.tileId: the ID of the tile that was hit.cellXandcellY: the coordinates of the cell containing the hit.
It returns null if the ray reaches its destination without hitting anything.
options.ignoreInside makes the ray ignore geometry that contains its starting point.
each(originX, originY, directionX, directionY, maxDistance, callback, options)
Walks along the ray and calls the callback once for every cell it reaches, including empty cells.
Returning false from the callback stops the traversal early.