I'm working on my own quadtree for use in games for physics (collision detection to be exact) but am unable to move an object from one node to another node.
What I'm doing is if some object is to be moved, I'm deleting it from its old position and adding a new object (with same property, such as width and height) to the new position. Is my approach correct or is there any other optimized process to do same?
The problem I'm facing is that if I move an object from node 0 to node 3 (both node being children of, for ex., root node) the root node container(I'm using std::vector) gets the object but it is not updated in the node 3's container.
Any solution to my problem? Though would be happy to try some other method too.