diff --git a/examples/osgwindows/osgwindows.cpp b/examples/osgwindows/osgwindows.cpp index 59f4b0329..e2b0da10d 100644 --- a/examples/osgwindows/osgwindows.cpp +++ b/examples/osgwindows/osgwindows.cpp @@ -32,8 +32,10 @@ static Producer::CameraConfig *BuildConfig(void) camera2->setOffset( -1.0, 0.0 ); Producer::InputArea *ia = new Producer::InputArea; - ia->addInputRectangle( rs1, Producer::InputRectangle(0.0,0.5,0.0,1.0)); - ia->addInputRectangle( rs2, Producer::InputRectangle(0.5,1.0,0.0,1.0)); +// ia->addInputRectangle( rs1, Producer::InputRectangle(0.0,0.5,0.0,1.0)); +// ia->addInputRectangle( rs2, Producer::InputRectangle(0.5,1.0,0.0,1.0)); + ia->addInputRectangle( rs1, Producer::InputRectangle(-1.0,0.0,-1.0,1.0)); + ia->addInputRectangle( rs2, Producer::InputRectangle(0.0,1.0,-1.0,1.0)); Producer::CameraConfig *cfg = new Producer::CameraConfig; diff --git a/include/osgGA/KeySwitchCameraManipulator b/include/osgGA/KeySwitchCameraManipulator index 123b22298..4b1999346 100644 --- a/include/osgGA/KeySwitchCameraManipulator +++ b/include/osgGA/KeySwitchCameraManipulator @@ -71,7 +71,7 @@ public: virtual osg::Camera * getCamera() { return _current->getCamera(); } - virtual void setNode(osg::Node* n) { _current->setNode(n); } + virtual void setNode(osg::Node* n); virtual const osg::Node* getNode() const { return _current->getNode(); } diff --git a/src/osgGA/KeySwitchCameraManipulator.cpp b/src/osgGA/KeySwitchCameraManipulator.cpp index 69ca9c4c9..b4ad8ffe2 100644 --- a/src/osgGA/KeySwitchCameraManipulator.cpp +++ b/src/osgGA/KeySwitchCameraManipulator.cpp @@ -35,13 +35,26 @@ void KeySwitchCameraManipulator::selectCameraManipulator(unsigned int num) { if (_current.valid()) { - itr->second.second->setNode(_current->getNode()); + if ( !itr->second.second->getNode() ) { + itr->second.second->setNode(_current->getNode()); + } itr->second.second->setCamera(_current->getCamera()); } _current = itr->second.second; } } +void KeySwitchCameraManipulator::setNode(osg::Node* node) +{ + for(KeyManipMap::iterator itr=_manips.begin(); + itr!=_manips.end(); + ++itr) + { + + itr->second.second->setNode(node); + } +} + CameraManipulator* KeySwitchCameraManipulator::getCameraManipulator(unsigned int num) { KeyManipMap::iterator itr = _manips.find(num); @@ -63,7 +76,9 @@ bool KeySwitchCameraManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapt KeyManipMap::iterator it=_manips.find(ea.getKey()); if(it != _manips.end()){ osg::notify(osg::INFO)<<"Switching to manipulator: "<<(*it).second.first<second.second->setNode(_current->getNode()); + if ( !it->second.second->getNode() ) { + it->second.second->setNode(_current->getNode()); + } it->second.second->setCamera(_current->getCamera()); it->second.second->init(ea,aa); _current = it->second.second; diff --git a/src/osgProducer/ViewerEventHandler.cpp b/src/osgProducer/ViewerEventHandler.cpp index f97695e39..484869077 100644 --- a/src/osgProducer/ViewerEventHandler.cpp +++ b/src/osgProducer/ViewerEventHandler.cpp @@ -839,7 +839,7 @@ bool ViewerEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActio // have already been recording so switch of recording. viewer->setRecordingAnimationPath(false); - osg::notify(osg::NOTICE) << "Finished recording camera animation, press 'Z' to reply."<< std::endl; + osg::notify(osg::NOTICE) << "To finished recording camera animation, press 'Z' to reply."<< std::endl; if (viewer->getAnimationPath()) {