The easiest method is removing and inserting the object, but there are probably faster methods. (If I'm overthinking this and I should just do it the simple way, let me know)
Here are some notes about my QuadTree
- The objects that are moving are AABBs and may be bigger than the smallest QuadTree node.
- The objects are not removed when creating children QuadTrees. That means the root QuadTree has a pointer to every object inside the QuadTree.
- The objects are stored as pointers in a vector outside of the QuadTree.
So far, each time an object moves it calls a function called Update() on the root QuadTree. It includes itself and its past bounding box before it moved in the parameters. I'm not sure how to make the function though.
Posting the entire code to my QuadTree here would make my post quite long, so I've created a GitHub repository for easier reading.
Edit: For anyone looking for an answer this seems to update objects by removing and deleting them and is pretty efficient judging by the test he did in the comments.