Added a render order sort to the list of Cameras being tested by the *Viewer::generatePointerData(..) method to ensure that the highest Camera gets focus.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14309 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-06-27 15:30:56 +00:00
parent d994e84288
commit 8d6bee6da9
4 changed files with 60 additions and 33 deletions

View File

@@ -680,6 +680,19 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
ref_ptr<DrawCallback> _finalDrawCallback;
};
/** Functor to assist with ordering camers in the order they should be rendered in.*/
struct CameraRenderOrderSortOp
{
inline bool operator() (const Camera* lhs,const Camera* rhs) const
{
if (lhs->getRenderOrder()<rhs->getRenderOrder()) return true;
if (rhs->getRenderOrder()<lhs->getRenderOrder()) return false;
return lhs->getRenderOrderNum()<rhs->getRenderOrderNum();
}
};
}
#endif