+ fix possible crash inside NavigationStyleP::viewAnimationCB if viewer has no camera node

This commit is contained in:
wmayer 2016-07-14 17:14:10 +02:00
parent ba72952dd8
commit ff060d4f1f

View File

@ -463,6 +463,8 @@ void NavigationStyleP::viewAnimationCB(void * data, SoSensor * sensor)
SbRotation slerp = SbRotation::slerp(that->spinRotation, PRIVATE(that)->endRotation, step);
SbVec3f focalpoint = (1.0f-step)*PRIVATE(that)->focal1 + step*PRIVATE(that)->focal2;
SoCamera* cam = that->viewer->getSoRenderManager()->getCamera();
if (!cam) return; // no camera
SbVec3f direction;
cam->orientation.setValue(slerp);
cam->orientation.getValue().multVec(SbVec3f(0, 0, -1), direction);