Quadtree for 2D collision detection
Your quadtree structure isn’t optimal. You’re right to store 4 subtrees per node, but actual objects should only be stored inside the leaves, not inner nodes. Therefore the collection holding the actual objects needs to be moved to the leaves. Let’s have a look at the implementation of the operations: Insert an object into the … Read more