Switching mode: [V] - edit quad tree [B] - single ray test [N] - sampled raycaster (casts a ray for every column) Editor: [Arrow keys/WASD] - move cursor [I] - go down in tree, divides quad if needed [O] - go up in tree [R] - change quad color
The quads have additional data to optimize finding neighboring quads. I tried to make it in a way that can be turned into an octree later.