Hey guys
I’m looking for a way to store moving, dynamic objects in quadtrees. Or better: I’m looking for a quadtree-like techneque to store objects, which move and are dynamic. The quadtree-like storage is supposed to only contain dynamic objects, since static objects are stored in a normal quadtree, which is the idea…
So the dynamic quadtree is cleared and filled every frame. Usually quadtrees aren’t supposed to be used like that. What’d you suggest?
One more thing: I’ve also search up on how to use them and I stumbled across this stackoverflow question, which gave 2 ways to do it or 2 ideas:
- A quadtree with Nodes being able to be node and leave at the same time, so AABB’s are stored at the smallest node they can be put into.
- A quadtree which stores all Rectangles in the leaves as a normal Point-storing-quadtree, but a reference to the Rectangle is hold to every possible leave in the quadtree. (So all leaves the rectangle covers store a reference to it)
So my question is:
Would you suggest a quadtree for storing dynamic objects, if not, what variation of quadtree would you suggest, or what other tree / thing would you suggest?
And:
How would you implement your dynamic quadtree, if you’d go about implementing one: Way 1, or way 2?