From 2903271331b00051c153ad8bd8956dbe89e08b53 Mon Sep 17 00:00:00 2001 From: Aesylwinn Date: Fri, 18 Mar 2016 16:07:15 -0400 Subject: [PATCH] Correct the center position for the orbit camera controller --- apps/opencs/view/render/cameracontroller.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/opencs/view/render/cameracontroller.cpp b/apps/opencs/view/render/cameracontroller.cpp index 74f72938f..c70f87565 100644 --- a/apps/opencs/view/render/cameracontroller.cpp +++ b/apps/opencs/view/render/cameracontroller.cpp @@ -409,11 +409,8 @@ namespace CSVRender { static const int DefaultStartDistance = 10000.f; - osg::Quat rotation = getCamera()->getViewMatrix().getRotate(); - osg::Vec3d position = getCamera()->getViewMatrix().getTrans(); - osg::Vec3d offset = rotation * (LocalForward * DefaultStartDistance); - - mCenter = position + offset; + osg::Vec3d eye, up; + getCamera()->getViewMatrixAsLookAt(eye, mCenter, up, DefaultStartDistance); mInitialized = true; }