Added check to init to prevent crash when no camera manipulator is supplied.

This commit is contained in:
Robert Osfield
2006-09-30 13:41:01 +00:00
parent dfffa56f64
commit c173eb49bc

View File

@@ -116,7 +116,11 @@ void SimpleViewer::init()
{
osg::ref_ptr<osgGA::GUIEventAdapter> initEvent = _eventQueue->createEvent();
initEvent->setEventType(osgGA::GUIEventAdapter::FRAME);
_cameraManipulator->init(*initEvent, *this);
if (_cameraManipulator.valid())
{
_cameraManipulator->init(*initEvent, *this);
}
}
void SimpleViewer::frame()