From fcccacc0faace18b5a66239e22f066133c996776 Mon Sep 17 00:00:00 2001 From: Aesylwinn Date: Fri, 18 Mar 2016 13:57:48 -0400 Subject: [PATCH] Define a constant for the World Up vector --- apps/opencs/view/render/cameracontroller.cpp | 2 ++ apps/opencs/view/render/cameracontroller.hpp | 2 ++ apps/opencs/view/render/scenewidget.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/render/cameracontroller.cpp b/apps/opencs/view/render/cameracontroller.cpp index fa2ad85605..8fc9c48017 100644 --- a/apps/opencs/view/render/cameracontroller.cpp +++ b/apps/opencs/view/render/cameracontroller.cpp @@ -13,6 +13,8 @@ namespace CSVRender Camera Controller */ + const osg::Vec3d CameraController::WorldUp = osg::Vec3d(0, 0, 1); + const osg::Vec3d CameraController::LocalUp = osg::Vec3d(0, 1, 0); const osg::Vec3d CameraController::LocalLeft = osg::Vec3d(1, 0, 0); const osg::Vec3d CameraController::LocalForward = osg::Vec3d(0, 0, 1); diff --git a/apps/opencs/view/render/cameracontroller.hpp b/apps/opencs/view/render/cameracontroller.hpp index e45e7bead0..44e35069b0 100644 --- a/apps/opencs/view/render/cameracontroller.hpp +++ b/apps/opencs/view/render/cameracontroller.hpp @@ -19,6 +19,8 @@ namespace CSVRender { public: + static const osg::Vec3d WorldUp; + static const osg::Vec3d LocalUp; static const osg::Vec3d LocalLeft; static const osg::Vec3d LocalForward; diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index c3b4b9a19f..d7049c1b54 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -321,7 +321,7 @@ void SceneWidget::selectNavigationMode (const std::string& mode) mCurrentCamControl->setCamera(NULL); mCurrentCamControl = mFreeCamControl.get(); mCurrentCamControl->setCamera(getCamera()); - mFreeCamControl->fixUpAxis(osg::Vec3d(0,0,1)); + mFreeCamControl->fixUpAxis(CameraController::WorldUp); } else if (mode=="free") {