Re: ssgVtxArrary and ssgSimpleList addtions + pui resize additions (was Re: [Plib-devel] Changing
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-08-07 05:57:13
|
Sam Stickland wrote: > Actually it would be nice to be able to provide the bounding sphere > myself :). In the case of an explosion if you know the position of the > fastest moving particle you can calculate the radius of the bounding > sphere from that. Hmmm - same as vertices - you can get a pointer to the bsphere: sgSphere *ssgEntity::getBSphere() ; ...then you can set the center and radius. sphere -> setCenter ( x, y, z ) ; sphere -> setRadius ( r ) ; Finally, you have to tell the API that you messed with it: ssgEntity::dirtyBSphere () ; ...which will cause all the bounding spheres from there on upwards to be dirtied and hence recalculated the next time they are rendered. > You could have a setBoundingSphere method (that would also have to dirty > all the spheres above it), but then changing an sgTransform would still > cause the explosions bounding sphere to be recalculated the expensive > way - perhaps a callback hook for bounding sphere calculations would be > best? Well, I think most people would just set the bsphere to the maximum radius and leave it there. -- 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 |