Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Quad Tree in STL for large outdoor Areas.

This topic is 5401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Helo Is it posible to implement a Quad Tree by using STL. Quad Tree will be used for large outdoor areas of the game. Requarement: * If ( node is NOT in camera view ) { Dismis this node and all other child nodes! } else RenderSubnode(); Q1) Is it posible to implement this kind of Rendering/Scene Hierarchy by using STL containers or do I have to code Quad Tree myself. Q2) Where can I found good free Tree library with which I can realize Quad Trees, and similar Trees?

Share this post

Link to post
Share on other sites
I was in the same position a few months ago, thinking about scene managemenet on a 2d tile based rpg.

You can check out the thread here:

and sure, you could use STL... using either a vector-vector or just a plain vector and a making it width*height large (then just use a simple function to get the right vector index with a x and a y coordinate. It''s something like i = x + y*height)

a better alternative to the vector might be Boost Array: http://www.boost.org/libs/array/index.htm
because the std::vector can increase and shrink in size during existence, and that''s probably not needed if your map is static (i.e. doesn''t add or delete cols/rows just because the character did something.)

But then there''s also Boost MultiArray: http://www.boost.org/libs/multi_array/doc/index.html

good luck

"No lies of sugar can sweeten the sournes of reality"

}+TITANIUM+{ A.K.A. DXnewbie[onMIRC]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!