Merge topic 'fixVRRendererResetCamera'

68ea612430 vtkVRRenderer: Fix hard coded translation when resetting camera

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Thomas Galland <thomas.galland@kitware.com>
Acked-by: Timothee Chabat <timothee.chabat@kitware.com>
Merge-request: !9719
This commit is contained in:
Tiffany Chhim 2022-12-01 14:05:36 +00:00 committed by Kitware Robot
commit 432d9e5ea3
1 changed files with 4 additions and 3 deletions

View File

@ -237,10 +237,11 @@ void vtkVRRenderer::ResetCamera(const double bounds[6])
// be done in the actors but then it requires every actor
// to be adjusted. It cannot be done with the camera model
// matrix as that is broken.
// The +distance in the Y translation is because we want
// the center of the world to be 1 meter up
// The additional distance translation in the view up direction is because we
// want the center of the world to be above the physical floor instead of at its level.
vtkVRRenderWindow* win = static_cast<vtkVRRenderWindow*>(this->GetRenderWindow());
win->SetPhysicalTranslation(-center[0], -center[1] + distance, -center[2]);
win->SetPhysicalTranslation(
-center[0] + vup[0] * distance, -center[1] + vup[1] * distance, -center[2] + vup[2] * distance);
win->SetPhysicalScale(distance);
}