AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkPhysics.RayCast Method (TAgkPoint, TAgkPoint)

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

Syntax
Pascal
class function RayCast(const P1: TAgkPoint; const P2: TAgkPoint): Boolean; overload; static;
Parameters 
Description 
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.

Copyright (c) 2012. All rights reserved.