19. Agenda
? History
? Definitions QuadTree
? Types QuadTree
? Intention QuadTree
? Using QuadTree
? Implementation of the operations
? Example
20. Implementation of the operations
1. Insert an object into the quadtree: Check if the object intersects the current
node. If so, recurse. If you've reached the leaf level, insert the object into the
collection.
2. Delete an object from the quadtree: Execute the exact same steps as if
inserting the object, but when you've reached the leaf level delete it from the
collection.
3. Test if an object intersects any object inside the quadtree: Execute the exact
same steps as if inserting the object, but when you've reached the leaf level
check for collision with all the objects in the collection.
4. Test for all collisions between all objects inside the quadtree: For every object
in the quadtree execute the single object collision test.
5. Update the quadtree: Delete all objects from the quadtree whose position has
been modified and insert them again.
21. Agenda
? History
? Definitions QuadTree
? Types QuadTree
? Intention QuadTree
? Using QuadTree
? Implementation of the operations
? Example
22. Example
X¨¦t v¨ª d? nh? h¨¬nh d??i. Ta c?n ki?m tra va ch?m c?a h¨¬nh ch? nh?t m¨¤u xanh v?i
c¨¢c ??i t??ng m¨¤u ??.