Jump to content
  • Advertisement
Sign in to follow this  
rjackets

What to include in a quad/oct -tree?

This topic is 4632 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

Just a quick question. In regards to quad/oct-trees. Do I include non-static things like the position of my player(s) in this tree and move them around within it dynamically? Or is it mostly useful for "mostly-static" stuff like terrain, objects, etc. I can imagine that the number of things you need to check in an entire environment is much larger than checking 32 players (or whatever) to see if they need to be rendered. Nonetheless, i figure it couldn't hurt to double check. SUMMARY: Should oct/quad-tree be preloaded and include only static objects?

Share this post


Link to post
Share on other sites
Advertisement
Depending on your engine design, It might be beneficial to store within each Entity object a pointer to the tree node within which it currently resides. This will make for fast access to the node's data. However, this scheme imposes the association of your Octree and Entity structures, which might not be desirable.

Alternatively, instead of a pointer/reference to the respective octree node, you could store a unique integer octree_node id which will serve as an index to an array of pointers to all the tree's nodes. This array could reside within the Octree structure, thus eliminating the explicit dependency.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!