I've roughly followed the osgmanipulator.cpp example to create
osgManipulator::Translate1DDragger objects and link them to my custom geometry
items and everything works fine. I'm encountering a problem when I try to
update a geometry item inside of the traverse method. The following code is
where it breaks:
Code:
void DraggerContainer::traverse(osg::NodeVisitor &nv)
{
//setup
....
//
osg::Vec3 trans = _dragger->getMatrix().getTrans();
_dragger->setMatrix( osg::Matrix::rotate(osg::inDegrees(degrees),rotationAxis)
* osg::Matrix::scale(scaleFactor)
* osg::Matrix::translate(trans)); //re-position the draggable item
if(prev_trans.length() != trans.length())
{
UpdateGeometry(trans); // <------- Breaks after this returns
}
osg::Group::traverse(nv);
}
The error is "vector iterator not incrementable vector line 99," but this
error is only produced after running through functions in viewer.dll and
osg.dll.
I'm wondering if this is the correct way to extrude geometry on the fly, and if
adding nodes during the traverse call will cause an iterator to become invalid.
Thanks in advance,
Braden
[/code]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53946#53946
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org