What to include in a quad/oct -tree?

Started by
1 comment, last by head_hunter 18 years, 5 months ago
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?
Advertisement
IMO yes. But I'm sure there are exceptions.

Matt
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
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.

This topic is closed to new replies.

Advertisement