Hi,

I need some help with the osg::Operation.
What I'm trying to achieve seems relatively simple. After loading a model, I want some background operation to visit with an intersections visitor.
Pseudo code:
Load Node
Create osg::Operation-derived ref_ptr and do
    mThreadedOperations->add(operation);
    viewer->addUpdateOperation(operation);
during runtime (e.g. before viewer.frame())

Unfortunately I'm experiencing crashes (vector iterator not dereferenceable etc) in the intersection visitor ( to be more exact: in the node->accept(*mIntersectionVisitor)) It works flawlessly if I let the body of the operation execute blocking after loading.

In my osg::Operation::operator()(osg::Object*) implementation I'm using the following scheme:

osgViewer::Viewer* viewer = dynamic_cast<osgViewer::Viewer*>(callingObject);
    if (viewer)
    {
        return;
    }
    else
    {
        runTheIntersectionVisitor(); ...
    }
Is there anything else I need to know? Examples for the osg::Operation are rare and I don't see from the given implementation if I need to lock anything.

Can someone give some insight on this?

Cheers
Sebastian
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to