Raycasting (or Ray Casting) is the process of “casting” or “tracing” a line from a point of origin towards a given direction and determining what objects are in its path.

It has several major domains of applications:

  • In graphics and rendering, to determine whether an object is lit or not
  • In physics, most notably to detect whether an object is grounded (as opposed to jumping / in the air)
  • In AI, it serves as a useful method to implement detection systems