[gameprogrammer] Re: Since we are on the topic of optomized data structures (:

  • From: Matthew Weigel <unique@xxxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Fri, 13 Jul 2007 14:05:59 -0500

Alan Wolfe wrote:
> Heya,
>  
> I have a quad tree which stores objects in it from a 2d world.
>  
> I was wondering, in general if i wanted to find a node in a quad tree
> where i had both the bounding box and a unique id#, would it be more
> efficient to just recursively search the tree for the id#?  Or would it
> be more efficient to do the bounding box search to "cull some branches"
> of the recursive ID search?

Quad trees excel at improving the performance of "finding things in a
bounding box."  It doesn't really matter what it is, as long as you have
the bounding box and the individual nodes possess the data you are
looking for.  If the tree were ordered with respect to id#s, that would
be different, though.
-- 
 Matthew Weigel
 hacker
 unique@xxxxxxxxxxx

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: