Hi Tom,
although I'd hope that anyone writing a CameraManipulator would implement both appropriately, otherwise an interface method is messed up! :)
Well yes obviously. But generally getMatrix() can just be written as return osg::Matrix::inverse(getInverseMatrix()); and you're done. Since it's not called by "the system" it's not that important if it isn't very optimal...
And actually the base class CameraManipulator::getMatrix() could do this by default, and then subclasses would only need to implement it if they knew they had to do better. But we're talking details here.
Am I correct in thinking you are advocating an approach that blends these two concepts?
Yes, well, advocating might be a strong word. I'm saying that conceptually, it would make sense that a CameraManipulator would be able to manipulate a camera in all ways necessary. But I'm not saying I want to do anything about it! :-)
In our software, we do something like what you describe, blending camera manipulators and an update callback on the camera. We have a data class that contains all settings we would want to be able to change on a camera. Our software can store multiple instances of this, which will represent different cameras we can switch to, but only one will be active for a given view at a time. Both the update callback and the manipulator have a pointer to the active camera data object, and they both apply the settings in this class when either we switch cameras or change the data inside this object at runtime, and make sure the data is up to date inside the object when the user alters the view using the camera manipulator.
The whole thing involves more classes than I think should be necessary, and it's a bit invasive, but it works well enough.
J-S -- ______________________________________________________ Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org