Skip to main content
gamedev.net
🔒 Locked

Octrees - Aggregation or Composition

Started by moagstar 0 replies 900+ views
Original Post
moagstar
moagstar
I was wondering how people implement their octrees, do you use them to actually store the specific instances of elements, or do you use them to store references of elements. At the moment I contain all the elements in an external list and add element pointers into the octree, at each level I add all the pointers to all the elements that are contained within that bounding volume, the idea being that I can create a large octree structure during initialisation and then at run-time decide to stop searching at a certain level if it is required, which I figure you wouldn't be able to do if you actually use composition to store the elements at the leaf nodes. One way around this could be to use composition at the leaf nodes but store references or pointers to all the elemenst contained within the volume. Which do you think is the best solution, pure aggregation, or composition at the leaf nodes with aggregation at the internal nodes?
oliii
oliii
definitely references/pointers/indices.

Any other way would be insane, especially if elements are shared between nodes. In any case actually. Just thinking of using composition for octrees makes my head spin.

Everything is better with Metal.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.