HI Brian,

You have to be very careful about adding or removing nodes during a
traversal as you can invalidate iterators by causing a reorgnization
of the structures the iterators are traversing.  From you code segment
it's unclear what is going on as you must have removed quite a bit of
code.

As a general note it's generally best add/removing elements from the
scene graph in the application's frame loop.

Robert.

On Wed, May 20, 2009 at 10:27 PM, Brian Stewart <[email protected]> wrote:
> Hi,
>
> I am trying to implement a mechanism by which selected objects in my scene 
> are highlighted. Searching the forum I found a reference to the Outline 
> effect (an implementation of osgFX::Effect)  on Ulrich Hertlein's web site 
> (http://www.sandbox.de/osg/), and I have attempted to integrate it into our 
> app - however, most of the time, whenever the object which is outlined first 
> comes into view, the app crashes in osg::NodeCallback::traverse, because the 
> _nestedCallback member is corrupted. This is on Windows Vista-64, running OSG 
> 2.6.1 built with Visual Studio 2008, in Debug mode. We are running OSG 
> multithreaded, and all my code setting up the effect is called from 
> osg::NodeCallback::operator() on the render thread. The general flow is as 
> follows:
>
>
> Code:
>
> osg::NodeCallback::operator()
> {
>   osg::PositionAttitudeTransform* modelTransform; // local transform to 
> position the model in the world
>   osg::Node* someChild; // some model
>   osg::ref_ptr<osgFX::Effect> fxNode = new osgFX::Outline();
>   fxNode->addChild( someChild );
>   modelTransform->addChild( fxNode.get() );
> }
>
>
>
>
> Am I missing something obvious? If not, ideas or debugging strategies would 
> also be greatly appreciated!
>
> Thank you!
> Brian
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=12628#12628
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to