From 60b5c6822146dcc2b273463f3108623a3fe9dd64 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 28 Jan 2007 09:30:11 +0000 Subject: [PATCH] From Vlad Danciu, fixed leaf depth sort functor --- include/osgUtil/StateGraph | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/osgUtil/StateGraph b/include/osgUtil/StateGraph index 454e4cb71..bffa5955c 100644 --- a/include/osgUtil/StateGraph +++ b/include/osgUtil/StateGraph @@ -28,11 +28,11 @@ namespace osgUtil { -struct LeafDepthSortFunctor +struct LessDepthSortFunctor { bool operator() (const osg::ref_ptr& lhs,const osg::ref_ptr& rhs) { - return (lhs->_depth>rhs->_depth); + return (lhs->_depth < rhs->_depth); } }; @@ -140,7 +140,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced inline void sortFrontToBack() { - std::sort(_leaves.begin(),_leaves.end(),LeafDepthSortFunctor()); + std::sort(_leaves.begin(),_leaves.end(),LessDepthSortFunctor()); } /** Reset the internal contents of a StateGraph, including deleting all children.*/