From cfdc6c788ed33d9a5dc5f3b7c2a2b687769f3f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Fri, 8 Dec 2017 00:05:50 +0100 Subject: [PATCH] CS: Make camera FOV change dynamically --- apps/opencs/view/render/scenewidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 46bbb29dd..7d3ac3f1c 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -374,6 +374,13 @@ void SceneWidget::settingChanged (const CSMPrefs::Setting *setting) { mOrbitCamControl->setOrbitSpeedMultiplier(setting->toDouble()); } + else if (*setting=="Rendering/camera-fov") + { + mView->getCamera()->setProjectionMatrixAsPerspective( + setting->toDouble(), + static_cast(width())/static_cast(height()), + 1.0f, 10000.0f); + } } void SceneWidget::selectNavigationMode (const std::string& mode)