From Riccardo Corsi, introduced CameraManipulator::updateCamera() method that allows more Camera properties to be controlled by the CameraManipulator.
This commit is contained in:
parent
f784884fd1
commit
65ab874143
@ -87,6 +87,10 @@ class OSGGA_EXPORT CameraManipulator : public GUIEventHandler
|
|||||||
/** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
|
/** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
|
||||||
virtual osg::Matrixd getInverseMatrix() const = 0;
|
virtual osg::Matrixd getInverseMatrix() const = 0;
|
||||||
|
|
||||||
|
/** update the camera for the current frame, typically called by the viewer classes.
|
||||||
|
Default implementation simply set the camera view matrix. */
|
||||||
|
virtual void updateCamera(osg::Camera* camera) { camera->setViewMatrix(getInverseMatrix()); }
|
||||||
|
|
||||||
/** Get the FusionDistanceMode. Used by SceneView for setting up stereo convergence.*/
|
/** Get the FusionDistanceMode. Used by SceneView for setting up stereo convergence.*/
|
||||||
virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const { return osgUtil::SceneView::PROPORTIONAL_TO_SCREEN_DISTANCE; }
|
virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const { return osgUtil::SceneView::PROPORTIONAL_TO_SCREEN_DISTANCE; }
|
||||||
|
|
||||||
|
@ -1159,7 +1159,8 @@ void CompositeViewer::updateTraversal()
|
|||||||
view->setFusionDistance( view->getCameraManipulator()->getFusionDistanceMode(),
|
view->setFusionDistance( view->getCameraManipulator()->getFusionDistanceMode(),
|
||||||
view->getCameraManipulator()->getFusionDistanceValue() );
|
view->getCameraManipulator()->getFusionDistanceValue() );
|
||||||
|
|
||||||
view->getCamera()->setViewMatrix( view->getCameraManipulator()->getInverseMatrix());
|
view->getCameraManipulator()->updateCamera(view->getCamera());
|
||||||
|
|
||||||
}
|
}
|
||||||
view->updateSlaves();
|
view->updateSlaves();
|
||||||
|
|
||||||
|
@ -1038,7 +1038,7 @@ void Viewer::updateTraversal()
|
|||||||
setFusionDistance( getCameraManipulator()->getFusionDistanceMode(),
|
setFusionDistance( getCameraManipulator()->getFusionDistanceMode(),
|
||||||
getCameraManipulator()->getFusionDistanceValue() );
|
getCameraManipulator()->getFusionDistanceValue() );
|
||||||
|
|
||||||
_camera->setViewMatrix(_cameraManipulator->getInverseMatrix());
|
_cameraManipulator->updateCamera(_camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSlaves();
|
updateSlaves();
|
||||||
|
Loading…
Reference in New Issue
Block a user