From ee9440d15567b6fbf4698488feac038763545e17 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 21 Feb 2007 19:06:43 +0000 Subject: [PATCH] Added Camera::s/getAllowsEventFocus() method to allow osgViewer to have non interfactive cameras such as RTT ones --- include/osg/Camera | 9 +++++++++ src/osg/Camera.cpp | 2 ++ 2 files changed, 11 insertions(+) diff --git a/include/osg/Camera b/include/osg/Camera index 6166630a4..ce1346402 100644 --- a/include/osg/Camera +++ b/include/osg/Camera @@ -64,6 +64,13 @@ class OSG_EXPORT Camera : public Transform, public CullSettings const osg::Stats* getStats() const { return _stats.get(); } + /** Set whether this camera allows events to be generated by the associated graphics window to be associated with this camera.*/ + void setAllowEventFocus(bool focus) { _allowEventFocus = focus; } + + /** Get whether this camera allows events to be generated by the associated graphics window to be associated with this camera.*/ + bool getAllowEventFocus() const { return _allowEventFocus; } + + /** Sets the clear color. */ inline void setClearColor(const Vec4& color) { _clearColor = color; } @@ -401,6 +408,8 @@ class OSG_EXPORT Camera : public Transform, public CullSettings View* _view; osg::ref_ptr _stats; + + bool _allowEventFocus; Vec4 _clearColor; GLbitfield _clearMask; diff --git a/src/osg/Camera.cpp b/src/osg/Camera.cpp index 417b2421c..6dd6a4414 100644 --- a/src/osg/Camera.cpp +++ b/src/osg/Camera.cpp @@ -17,6 +17,7 @@ using namespace osg; Camera::Camera(): _view(0), + _allowEventFocus(true), _clearColor(osg::Vec4(0.0f,0.0f,0.0f,1.0f)), _clearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT), _transformOrder(PRE_MULTIPLY), @@ -34,6 +35,7 @@ Camera::Camera(const Camera& camera,const CopyOp& copyop): Transform(camera,copyop), CullSettings(camera), _view(camera._view), + _allowEventFocus(camera._allowEventFocus), _clearColor(camera._clearColor), _clearMask(camera._clearMask), _colorMask(camera._colorMask),