Quote:
Why are you reinserting the objects?
If an object changes size, rotates or moves, it might have to be reassigned to a new node as it could no longer be contained inside its current node.
Quote:
And how?
private void ReinsertObject(IQuadtree_Object o) {#if DEBUG objectsUpdated++;#endif // Remove the object from the current node RemoveObject(quadtree_Root, o); // Reinsert the object along with its updated parameters that affect node placement (position, size, etc.) InsertObject(quadtree_Root, o); }
Is this not the norm for quadtrees, or am I making this process too complicated?
Quote:
When o is tested, it will report all possible collisions between o and everything else. The reverse holds true as well, so o will never need to be tested again.
What if o is overlapping 2 objects and both overlaps need to be resolved?
If I flag o as tested then o will only be tested against one object?
EDIT:
Quote:
When o is tested, it will report all possible collisions between o and everything else.
How can I test against all other objects in the quadtree for one object when I need to traverse the parent nodes in a logical order?
Eg:
If the object is in a child node then it must be tested against parent/ancestor nodes. It makes no sense to me to test each object individually when I can test all objects stored at the current node depth against parent/ancestors.
Wouldn't your method require traversing through all ancestors for every object in the tree?
I'm lost on your logic, could you help me out please?
[Edited by - Spa8nky on March 31, 2010 11:32:46 AM]