Gui: Improve object center rotation mode

This commit is contained in:
Rexbas
2023-07-22 15:20:10 +02:00
committed by Chris Hennes
parent 1afa0d2843
commit 20c462f45a
6 changed files with 45 additions and 5 deletions

View File

@@ -1082,8 +1082,9 @@ void NavigationStyle::saveCursorPosition(const SoEvent * const ev)
if (!cam) // no camera
return;
// Get the bounding box center of the physical object group
SoGetBoundingBoxAction action(viewer->getSoRenderManager()->getViewportRegion());
action.apply(viewer->getSceneGraph());
action.apply(viewer->objectGroup);
SbBox3f boundingBox = action.getBoundingBox();
SbVec3f boundingBoxCenter = boundingBox.getCenter();
setRotationCenter(boundingBoxCenter);