Jump to content
  • Advertisement

Archived

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

Fusi0n

storing dynamic objects in more than one list

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

lo all, im having some problems with storing objects in the nodes of an octree. i have a global linked list that stores all the objects in the octree, however i would like the octree nodes to also store a linked list of the objects it contains, but cannot find a way of storing the *next and *prev pointers outside of the actual objects. so basically i need to store objects in more than one dunamic list at the same time :s anyone have any clues? thanks for your time :D Fusi0n^ "We are what we repeatedly do. Excellence, then, is not an act, but a habit." - Aristotle

Share this post


Link to post
Share on other sites
Advertisement
i think i have found a solution:

we define a CLinkedList class and a CLinkedListNode.

CLinkedList stores a p_head and a p_tail of CLinkedListNode for thelinked list. CLinkedListNode stores a pointer to a base class. of course this can be templatised for use with any object without need for rtti :D \o/

unless im wrong ;p

"We are what we repeatedly do. Excellence, then, is not an act, but a habit." - Aristotle

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.

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!