linecasting
Linecasting is a computational query used to determine whether a straight line segment between two points intersects any geometry or objects in a scene, and if so, where along the segment the first intersection occurs. It is widely used in video games, robotics, computer graphics, and geographic information systems for purposes such as collision detection, visibility testing, and sensor simulation. Unlike raycasting, linecasting is finite in length and yields a specific exit distance.
In two dimensions and grid-based environments, linecasting often advances along the line using Bresenham's line algorithm
Common algorithms include Bresenham/DDA for grid traversal, and clipping or intersection tests such as Liang–Barsky, Cohen–Sutherland,
Applications span weapon hit detection (hitscan), line-of-sight checks, laser beams, shadow or camera visibility tests, and
Linecasting shares concepts with raycasting but is constrained to a finite segment. Its robustness depends on