>>20248
>but why can buckets hold more than one item?
You mean points? Most implementations have an arbitrary number of points/entities each node can have, and it splits after that. This happens because there is nothing wrong with having more than one point in the same node, as long as the number is reasonable to avoid checking too many collisions between them.
Of course, that also means you could set 1 as the maximum number of points a node can hold so it splits as soon as another one enters the zone
>If it gets dense enough, wouldn't it get into decimals values and break your implementation?
Why? An int will always be an int.
Unless you are using some weird dynamically typed language, something you should never do.
Single-object quadtree:
https://www.youtube.com/watch?v=fuexOsLOfl0
Multiples object quadtree:
https://www.youtube.com/watch?v=TJzq_kjtGTc
I would say the first one is much more efficient with lots of objects if you pool the quadtree. If you are creating new nodes on the fly though, you might want to up the threshold.