Problem with my Scenegraph tree

Started by
0 comments, last by JasonBlochowiak 17 years, 8 months ago
Hi, First sorry for the very general subject, but i didn't how how to describe my problem in that short subjetc line. I have a design problem(i haven't been programming for abou 2 months just because of design probs) with my scenegraph(a simple tree): I want to store the traversed form of the tree(a std::list of nodes) somewhere(atm it's stored with the root of the tree) and i thought it would be faster to update that list when adding a node to the tree and not building the list every frame from scratch. Now i have some problems with that approach. I thought i simply store an iterator for the list in every node, and when adding a children to a node it can just add itself at the right position in the list,as it has the iterator of its parent(and the iterator for its siblings). But that would mean i would be restricted to building the tree from the top(root) down(leaves) and i have to pay special attention in what order i add children to nodes. This introduces potential bug sources and is not good design(is it?). So should i just build the list from scratch each frame? or update it everytime something changes. If later: how can i accomplish that? i hope i made clear what i want. thanks in advance. regards, m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
Advertisement
Sounds like you've fallen victim to premature optimization.

Neverminding any hackish issues with updating a traversal list, why bother with the traversal list instead of just traversing your tree? Are you dealing with tens of thousands of tree nodes?

This topic is closed to new replies.

Advertisement