From 7d36dd68dcc4e3b245a119a948959b9f91f37752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Thu, 7 Dec 2017 23:52:05 +0100 Subject: [PATCH] CS: Make orbit camera not change roll --- apps/opencs/view/render/cameracontroller.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/opencs/view/render/cameracontroller.cpp b/apps/opencs/view/render/cameracontroller.cpp index 7b802b0ef..cb1278805 100644 --- a/apps/opencs/view/render/cameracontroller.cpp +++ b/apps/opencs/view/render/cameracontroller.cpp @@ -673,6 +673,7 @@ namespace CSVRender { osg::Vec3d eye, center, up; getCamera()->getViewMatrixAsLookAt(eye, center, up); + up = osg::Vec3(0,0,1); osg::Quat rotation = osg::Quat(value, up); osg::Vec3d oldOffset = eye - mCenter; @@ -685,6 +686,7 @@ namespace CSVRender { osg::Vec3d eye, center, up; getCamera()->getViewMatrixAsLookAt(eye, center, up); + up = osg::Vec3(0,0,1); osg::Vec3d forward = center - eye; osg::Quat rotation = osg::Quat(value, up ^ forward);