I used some clever techniques I learned when developing menger-sponge ray-tracing, going beyond simple BVH or Grid-Based stepping. Controls: press; t - changes one ray to circle of rays (45 or 360 on turbowarp) s - direction changes slower when clicking a and d r - stop the simulation I should work on offset grid (like hexagonal grid but in generalized case) and yes, you can theoretically put any object instead of circles, but needs a clear boundary similar to circles radius variable if you don't want to greatly change the culling code
In this case, I think I can make ray-grid intersection checks in finite time (theoretically the worst-case scenario increases exponentially with greatly spaced-out circles) It comes down to all possible rational slopes a ray can take and never hit a circle. 1/1 is possible in this setup, 1/2 is possible in 7 spacing and 1 circle radius. In these scenarios ray is in between two lines that are 45 degrees and 60 or 30 degrees (including all rotations) these lines are tangent to infinite number of circles It's not hard to do it but it would be hard to generalize it for all cases and get finite time (binary search and irrational to closest and smallest rational number estimates that do not increase in samples) I'm gonna come back soon (maybe tomorrow or couple years or never)