Non-Subspace Related Coding - Quadtree C# fun! Doc Flabby - Thu Sep 11, 2008 11:56 am Post subject: Quadtree C# fun!
Working on a Quadtree implementation to help with fast collison detection for STF. Its pretty cool and took me ages to understand so i thought i would share.
Left Click = Place Point
Right Click + Drag = define test area.
The points that are included in the collision test color red.
I now just need to improve it so it handles tilesof variable size instead of points...
This program is just a test driver for the quadtree class (src included)
Bak - Sat Sep 13, 2008 4:23 am Post subject:
i remember doing that for solar system simulation gravity simulation for a class project (turns out you can approximate gravity O(N*logN) instead of O(N^2)).
Anyways, if three points are on the same exact spot does it create a tree of infinite depth until my computer runs out of memory?
Doc Flabby - Sat Sep 13, 2008 9:15 am Post subject:
Bak wrote:
Anyways, if three points are on the same exact spot does it create a tree of infinite depth until my computer runs out of memory?
Nope. You'd just create 3 more levels to the tree I think.