Game Development Community

Raycasting?

by Jeremy Stieglitz · in Torque Game Builder · 07/13/2009 (9:32 pm) · 2 replies

Hey all, does anyone know if there is a function that can do a "2D trace" (raycast) in the World and return whatever object(s) it collided with? Or some method of setting up a collision check to have the same result? Or would I have to add some C++ functionality for this? ;)

Thanks,
Jeremy

#1
07/13/2009 (10:05 pm)
Raycasting in TGB is called "picking". There are a series of "pick" functions in t2dSceneGraph in the documentation, including pickLine, pickRect and pickRadius. Very handy functions!
#2
07/13/2009 (11:58 pm)
Awesome, thank you :)

-Jer