From 16801f82e0014ed1bf8cff52101ff0048bea56cf Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 7 Nov 2005 15:43:29 +0000 Subject: [PATCH] From Steve Lunsford, added psuedo event dispatch to init within selectCameraManipulator to force the new minpulator to update correctly. --- src/osgProducer/Viewer.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/osgProducer/Viewer.cpp b/src/osgProducer/Viewer.cpp index cdc706f1a..ec97b8f6d 100644 --- a/src/osgProducer/Viewer.cpp +++ b/src/osgProducer/Viewer.cpp @@ -944,7 +944,17 @@ bool Viewer::computeIntersections(float x,float y,osgUtil::IntersectVisitor::Hit void Viewer::selectCameraManipulator(unsigned int no) { - if (_keyswitchManipulator.valid()) _keyswitchManipulator->selectMatrixManipulator(no); + if (_keyswitchManipulator.valid()) + { + _keyswitchManipulator->selectMatrixManipulator(no); + + // keyswitch manipulator doesn't yet force manipulators to init themselves + // so we'll do this mannually. Note pretty, and needs replacing by a refactor + // of MatrixMinpulators in the longer term. + osg::ref_ptr ea = new EventAdapter; + ea->adaptKeyPress(_kbmcb->getTime(), osgGA::GUIEventAdapter::KEY_KP_1+no); + _keyswitchManipulator->init(*ea, *this); + } } void Viewer::getCameraManipulatorNameList( std::list &nameList )