Hi Riccardo, The current osgGA::CameraManipulator's are a bit of mess, the way they just control the view matrix is one of their flaws. I merged a set of sweeping changes from Jan Perciva back in May 2010 that added a new inheritance hierarchy and more features, but in hindsight I feels these have just made them more convoluted in design and implementation.
Rather than tweak the current CameraManilulator API I feel that a wholesale review of osgGA and the CameraManipulator is long overdue. We have new devices such as multi-touch and MS's Kinect, as well as old ones like joysticks that are really not served properly by osgGA. We really should try and tie these all together. Perhaps this should be an objective for 3.4. In terms of osgGA::CameraManipulator base class I'd like to distil it down to it's core functionality - allowing a manipulator to control a Camera. Potentially we could introduce this change prior to the wholesale revamp. Robert. On 5 March 2012 17:35, Riccardo Corsi <[email protected]> wrote: > Hi Robert and All, > > in more than one occasion I've noticed that having access to the camera > manipulator in use is not enough to have "full control" over the camera > motion handling. > > An example is if you want to temporary disable the manip to set the camera > position explicitly (in this case you need to remove the manipulator from > the viewer, not to get the position overwritten), > or if you want to write a manip for an ortho camera, in which case you need > access to the camera's projection matrix as well. > > At the same time we need to preserve the loose coupling between the camera > and its manipulator. > > I think that a possible approach would be a virtual method in the base > camera manip like: > virtual void osgGA::CameraManipulator::UpdateCamera(osg::Camera* pCam) > to be invoked by the viewer classes. > Instead of asking the ViewMatrix to the manipulators, they would call this > method passing the reference camera and leaving the matrix assignments to > the implementation. > > Do you think it's a reasonable approach? > The porting of the existing manipulators to the new interface would be an > easy task. > > Please give me some feedback, > if you like the approach I can submit a patch. > > Thanks, > Ricky > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

