From 3a676fc45648798ef4148c883c1524cdf221ffe4 Mon Sep 17 00:00:00 2001 From: Aesylwinn Date: Fri, 18 Mar 2016 16:06:35 -0400 Subject: [PATCH] Revert "Create a visual representation of the center of the orbit camera." This reverts commit 2c894acd98ed593c8433e29443f84035a2c74297. # Conflicts: # apps/opencs/view/render/cameracontroller.cpp # apps/opencs/view/render/cameracontroller.hpp --- apps/opencs/view/render/cameracontroller.cpp | 24 +------------------- apps/opencs/view/render/cameracontroller.hpp | 7 +----- apps/opencs/view/render/scenewidget.cpp | 2 +- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/apps/opencs/view/render/cameracontroller.cpp b/apps/opencs/view/render/cameracontroller.cpp index 49e14bfa0..7e677b2db 100644 --- a/apps/opencs/view/render/cameracontroller.cpp +++ b/apps/opencs/view/render/cameracontroller.cpp @@ -3,12 +3,8 @@ #include #include -#include -#include #include #include -#include -#include namespace CSVRender { @@ -265,7 +261,7 @@ namespace CSVRender Orbit Camera Controller */ - OrbitCameraController::OrbitCameraController(osg::Group* group) + OrbitCameraController::OrbitCameraController() : mInitialized(false) , mFast(false) , mLeft(false) @@ -276,10 +272,7 @@ namespace CSVRender , mRollRight(false) , mCenter(0,0,0) , mDistance(0) - , mCenterNode(new osg::PositionAttitudeTransform()) { - group->addChild(mCenterNode); - createShape(); } bool OrbitCameraController::handleKeyEvent(QKeyEvent* event, bool pressed) @@ -391,8 +384,6 @@ namespace CSVRender if (mRollRight) roll(rotDist); - mCenterNode->setPosition(mCenter); - // Normalize the matrix to counter drift getCamera()->getViewMatrix().orthoNormal(getCamera()->getViewMatrix()); @@ -416,19 +407,6 @@ namespace CSVRender mInitialized = true; } - void OrbitCameraController::createShape() - { - const float boxWidth = 100; - - osg::ref_ptr box = new osg::Box(osg::Vec3f(0, 0, 0), boxWidth); - osg::ref_ptr drawable = new osg::ShapeDrawable(box); - drawable->setColor(osg::Vec4f(0.f, 0.9f, 0.f, 1.f)); - - osg::ref_ptr geode = new osg::Geode(); - geode->addChild(drawable); - mCenterNode->addChild(geode); - } - void OrbitCameraController::rotateHorizontal(double value) { osg::Vec3d eye, center, up; diff --git a/apps/opencs/view/render/cameracontroller.hpp b/apps/opencs/view/render/cameracontroller.hpp index 78afe2320..cced8a4c3 100644 --- a/apps/opencs/view/render/cameracontroller.hpp +++ b/apps/opencs/view/render/cameracontroller.hpp @@ -4,7 +4,6 @@ #include #include -#include #include #include @@ -13,7 +12,6 @@ class QKeyEvent; namespace osg { class Camera; - class Group; } namespace CSVRender @@ -99,7 +97,7 @@ namespace CSVRender { public: - OrbitCameraController(osg::Group* group); + OrbitCameraController(); bool handleKeyEvent(QKeyEvent* event, bool pressed); bool handleMouseMoveEvent(std::string mode, int x, int y); @@ -111,7 +109,6 @@ namespace CSVRender void onActivate(); void initialize(); - void createShape(); void rotateHorizontal(double value); void rotateVertical(double value); @@ -123,8 +120,6 @@ namespace CSVRender bool mFast, mLeft, mRight, mUp, mDown, mRollLeft, mRollRight; osg::Vec3d mCenter; double mDistance; - - osg::ref_ptr mCenterNode; }; } diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index dc0041c0f..27c828ec4 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -164,7 +164,7 @@ SceneWidget::SceneWidget(boost::shared_ptr resourceSys , mPrevMouseX(0) , mPrevMouseY(0) , mFreeCamControl(new FreeCameraController()) - , mOrbitCamControl(new OrbitCameraController(mRootNode)) + , mOrbitCamControl(new OrbitCameraController()) , mCurrentCamControl(mFreeCamControl.get()) , mCamPositionSet(false) {