Re: [Plib-users] <<code review>> Bounding sphere of a branch node
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-02-29 06:55:20
|
Steve Baker wrote: > > But think about a scenario where a Branch group has a > > leaf ssgRahulLeaf which is derived from ssgLeaf and > > has a different constrcutor which does not invoke > > recalcBSphere in it. Also imagine that the user of the > > ssg API did not call flatten on the scene graph before > > renedering it. Will the bounding spheres of the branch > > nodes be updated in this case ? Oops - missed that comment. If you fail to tell ssgRahulLeaf to do a recalcBSphere then the leaf node's bsphere will not have been computed, and (in theory) the first time the node is called upon to getBSphere, it *should* be computed. That will typically happen the first time the scene graph is rendered. I noticed though that ssgEntity (the base class for all scene graph nodes) does not dirty the sphere in its constructor function - so if you really did do that, things would be a little undefined. I just fixed that by setting invalidBSphere TRUE in the ssgEntity constructor. -- Steve Baker http://web2.airmail.net/sjbaker1 sjb...@ai... (home) http://www.woodsoup.org/~sbaker sj...@ht... (work) |