From ff060d4f1f58298482f8b1f40e383f2a5839e50b Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 14 Jul 2016 17:14:10 +0200 Subject: [PATCH] + fix possible crash inside NavigationStyleP::viewAnimationCB if viewer has no camera node --- src/Gui/NavigationStyle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index 313f42b21..c49472ffa 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -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);