Hi Stefan, On 2 March 2015 at 10:25, Stefan Zellmann <[email protected]> wrote:
> I just tried registering a computeBoundingSphere callback as Laurens > suggested - this looks quite promising: with my static obj files the > callback got triggered only once, while the animated VRML file resulted in > triggering the callback frequently. However, the application's view_all > function also seems to trigger the callback, although I believe that the > latter doesn't "dirty" the bounds. > > How exactly is the callback meant to work? Is it triggered when the bounds > are dirty, or each time the bounds were somehow interacted with? > The ComputeBoundsCallback is only called when the Bound is dirtied, once it's computed the value is stored on the osg::Drawable/osg::Node. Perhaps rather than use the ComputeBoundCallback you could write a NodeVisitor that traverses the scene graph following subgraphs that the have the _boundingSphereComputed set to true. The tricky bit right now is that the bool Node::boundingSphereComputed is a protected member variable with no public access. The other complication is that as soon as getBound() is done on the root node all the dirty bounds will be recomputed, so you'd need to intercept the scene graph before a getBound() is done. > "ModifiedCount" is probably only set when the VBO codepath is active, or > is it more general (e.g. display lists)? > Not all code that modifies osg::Array's assigned to osg::Geometry will currently call dirty() on the array as it's quite a recent feature, so rather than it being a VBO specific issue it's an issue that usage of Modified isn't complete. -- The bottom line though, is what you are trying to do isn't typically OSG application usage so there are no specific mechanism to make this task easier - the OSG is focus on rendering a scene using OpenGL. Doing what you doing is really interesting but because it's so novel you'll likely have to be quite a bit more creative than the average new OSG user as you doing stuff even I haven't attempted bofore. Robert.
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

