From 4fbaca7878565eb761e52d34db31a43032813df8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 14 May 2018 09:34:04 +0100 Subject: [PATCH] Fixed support for update and event callbacks on StateSet/Uniform/StateAttributes on View(er) Cameras. --- src/osgViewer/CompositeViewer.cpp | 8 ++++---- src/osgViewer/Viewer.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/osgViewer/CompositeViewer.cpp b/src/osgViewer/CompositeViewer.cpp index 99fdd6e55..81e375791 100644 --- a/src/osgViewer/CompositeViewer.cpp +++ b/src/osgViewer/CompositeViewer.cpp @@ -1278,13 +1278,13 @@ void CompositeViewer::eventTraversal() osg::NodeVisitor::TraversalMode tm = _eventVisitor->getTraversalMode(); _eventVisitor->setTraversalMode(osg::NodeVisitor::TRAVERSE_NONE); - if (view->getCamera() && view->getCamera()->getEventCallback()) view->getCamera()->accept(*_eventVisitor); + if (view->getCamera()) view->getCamera()->accept(*_eventVisitor); for(unsigned int i=0; igetNumSlaves(); ++i) { osg::View::Slave& slave = view->getSlave(i); osg::Camera* camera = view->getSlave(i)._camera.get(); - if (camera && slave._useMastersSceneData && camera->getEventCallback()) + if (camera && slave._useMastersSceneData) { camera->accept(*_eventVisitor); } @@ -1412,13 +1412,13 @@ void CompositeViewer::updateTraversal() osg::NodeVisitor::TraversalMode tm = _updateVisitor->getTraversalMode(); _updateVisitor->setTraversalMode(osg::NodeVisitor::TRAVERSE_NONE); - if (view->getCamera() && view->getCamera()->getUpdateCallback()) view->getCamera()->accept(*_updateVisitor); + if (view->getCamera()) view->getCamera()->accept(*_updateVisitor); for(unsigned int i=0; igetNumSlaves(); ++i) { osg::View::Slave& slave = view->getSlave(i); osg::Camera* camera = slave._camera.get(); - if (camera && slave._useMastersSceneData && camera->getUpdateCallback()) + if (camera && slave._useMastersSceneData) { camera->accept(*_updateVisitor); } diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index d3f66cf2f..85ed02017 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -1083,13 +1083,13 @@ void Viewer::eventTraversal() osg::NodeVisitor::TraversalMode tm = _eventVisitor->getTraversalMode(); _eventVisitor->setTraversalMode(osg::NodeVisitor::TRAVERSE_NONE); - if (_camera.valid() && _camera->getEventCallback()) _camera->accept(*_eventVisitor); + if (_camera.valid()) _camera->accept(*_eventVisitor); for(unsigned int i=0; igetEventCallback()) + if (camera && slave._useMastersSceneData) { camera->accept(*_eventVisitor); } @@ -1189,13 +1189,13 @@ void Viewer::updateTraversal() osg::NodeVisitor::TraversalMode tm = _updateVisitor->getTraversalMode(); _updateVisitor->setTraversalMode(osg::NodeVisitor::TRAVERSE_NONE); - if (_camera.valid() && _camera->getUpdateCallback()) _camera->accept(*_updateVisitor); + if (_camera.valid()) _camera->accept(*_updateVisitor); for(unsigned int i=0; igetUpdateCallback()) + if (camera && slave._useMastersSceneData) { camera->accept(*_updateVisitor); }