Author |
Message |
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: 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)
_________________ Rediscover online gaming. Get Subspace | STF The future...prehaps
Screenshot
quadtree.jpg - 23.85 KB
File downloaded or viewed 83 time(s)
Source + Bin
QuadTreeTest.zip - 900.94 KB
File downloaded or viewed 231 time(s)
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:24 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: 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? _________________ SubSpace Discretion: A Third Generation SubSpace Client
|
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: 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.
Its a variation on a Binary Tree Structure..
|
|
Back to top |
|
|
|