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

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 X1: Single; const Y1: Single; const X2: Single; const Y2: Single): Boolean; overload; static;
Parameters 
Description 
const X1: Single 
The X coordinate of the start point in world coordinates. 
const Y1: Single 
The Y coordinate of the start point in world coordinates. 
const X2: Single 
The X coordinate of the end point in world coordinates. 
const Y2: Single 
The Y coordinate of 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.