From 1eed180a5cf4633b0390cf16a30602b9fea5651a Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 2 Nov 2014 11:41:11 +1100 Subject: [PATCH] Fix Gcc/MSVC differences with friend class. Invert camera derived direction. --- apps/opencs/view/render/mousestate.cpp | 5 +++-- apps/opencs/view/render/worldspacewidget.cpp | 1 - apps/opencs/view/render/worldspacewidget.hpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/opencs/view/render/mousestate.cpp b/apps/opencs/view/render/mousestate.cpp index 5c5279b7a..90ca522c1 100644 --- a/apps/opencs/view/render/mousestate.cpp +++ b/apps/opencs/view/render/mousestate.cpp @@ -335,6 +335,7 @@ namespace CSVRender { CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); QString coord = userSettings.setting("debug/mouse-reference", QString("screen")); + Ogre::Vector3 derived = getCamera()->getDerivedDirection(); QString wheelDir = userSettings.setting("debug/mouse-wheel", QString("Closer/Further")); if(wheelDir == "Left/Right") @@ -342,7 +343,7 @@ namespace CSVRender if(coord == "world") return std::make_pair(Ogre::Vector3::UNIT_Y, Ogre::Vector3::UNIT_X); else - return std::make_pair(getCamera()->getDerivedRight(), getCamera()->getDerivedDirection()); + return std::make_pair(getCamera()->getDerivedRight(), Ogre::Vector3(-derived.x, -derived.y, -derived.z)); } else if(wheelDir == "Up/Down") { @@ -356,7 +357,7 @@ namespace CSVRender if(coord == "world") return std::make_pair(Ogre::Vector3::UNIT_X, Ogre::Vector3::UNIT_Y); else - return std::make_pair(getCamera()->getDerivedDirection(), getCamera()->getDerivedRight()); + return std::make_pair(Ogre::Vector3(-derived.x, -derived.y, -derived.z), getCamera()->getDerivedRight()); } } diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index 0503d4d63..ee119c939 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -19,7 +19,6 @@ #include "../world/physicsmanager.hpp" #include "../world/physicssystem.hpp" -#include "mousestate.hpp" #include "elements.hpp" CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent) diff --git a/apps/opencs/view/render/worldspacewidget.hpp b/apps/opencs/view/render/worldspacewidget.hpp index 2dfe2b871..40799d86a 100644 --- a/apps/opencs/view/render/worldspacewidget.hpp +++ b/apps/opencs/view/render/worldspacewidget.hpp @@ -2,6 +2,7 @@ #define OPENCS_VIEW_WORLDSPACEWIDGET_H #include "scenewidget.hpp" +#include "mousestate.hpp" #include "navigation1st.hpp" #include "navigationfree.hpp"