use the uniform_grid functions as aoi solution: https://github.com/rangercyh/quadtree
code come from the stackoverflow answer: https://stackoverflow.com/questions/41946007/efficient-and-well-explained-implementation-of-a-quadtree-for-2d-collision-det
more detail see: https://github.com/rangercyh/quadtree