Hi All,
I'm just reviewing Jason Daly's submission of Kamil Krupa's fix to
Optimizer.cpp as a workaround to the problem handling some OpenFlight
files. Jason kindly stepped in making as alas Kamil didn't get around
to sending it to osg-submission.
I have now reviewed the fix and am not entirely comfortable with the
changes. I'm not 100% sure of the failure mechanism as I don't have a
model that reproduces the problem first hand. Reading the posts it
seems the LessGeode functor was buggy, and reviewing it I can see that
it could fail in certain circumstances. The culprit is:
struct LessGeode
{
bool operator() (const osg::Geode* lhs,const osg::Geode* rhs) const
{
if (lhs->getStateSet()<rhs->getStateSet()) return true;
if (lhs->getNodeMask()<rhs->getNodeMask()) return true;
return false;
}
};
I think the a better implementation would be:
struct LessGeode
{
bool operator() (const osg::Geode* lhs,const osg::Geode* rhs) const
{
if (lhs->getNodeMask()<rhs->getNodeMask()) return true;
if (lhs->getNodeMask()>rhs->getNodeMask()) return false;
return (lhs->getStateSet()<rhs->getStateSet());
}
};
I don't a model to test. I have just tested the OpenFlight models I
have here and all run OK, but then they did before...
Soo... I've just checked in my change to Optimizer.cpp into SVN, you
can also grab it only via:
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgUtil/Optimizer.cpp
Could OpenFlight users try out this change and let me know if things
are fixed, or hooorribbly borken...
Thanks,
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org