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/branches/OpenSceneGraph-3.2@14308 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-06-27 15:30:50 +00:00
parent 78a59c33bd
commit 2f83db9442
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