AGK for Pascal
TAgkPhysics.RayCastGroup Method (Integer, TAgkPoint, TAgkPoint)

Casts a ray through all physics objects including sprites that have physics turned on and stores the closest item hit.

class function RayCastGroup(const Group: Integer; const P1: TAgkPoint; const P2: TAgkPoint): Boolean; overload; static;
const Group: Integer 
The group ID to check for intersection with the ray, can be negative. 
const P1: TAgkPoint 
The start point in world coordinates. 
const P2: TAgkPoint 
The end point in world coordinates. 

True if there was a collision, False if not.

Results of a ray cast can be retrieved using the other ray cast functions and properties such as RayCastNormal

If the ray starts inside a shape that shape will not be counted in the results. 

This function filters the sprites that are checked so only sprites of a certain group are checked, a group value of 0 means all groups will be checked.

Copyright (c) 2012. All rights reserved.