Re: [Plib-users] Custom Traversal
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-12-02 00:12:50
|
Devrim Erdem wrote: > > > Devrim Erdem wrote: > > > > > I want to add pre and post draw callback functions for each node under a > > > certain branch ( an flt model ). Since there are no callbacks for > > > branches I need to traverse the branch to find all the ssgLeaf's.. Is > > > there a ssgTraverse function or a class ? > > > > I'm not too thrilled about DRAW callbacks at the BRANCH level - because it'll > > cause horrible grief if/when we get around to sorting leaf nodes by material > > property (which would be a significant speedup in some cases). > > I have seen the previous postings. So how can I find the the ssgLeaf nodes under > a branch ? Well, you have ssgBranch::getNumKids(), ssgBranch::getKid(n) and ssgEntity::isAKindOf() ...so you have all the tools you need to walk down the tree checking nodes to see if they are derived from ssgLeaf. A simple recursive tree-walk can easily be put together in a dozen lines of code. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |