forked from mirror/openmw-tes3mp
Revert "Create a visual representation of the center of the orbit camera."
This reverts commit 2c894acd98
.
# Conflicts:
# apps/opencs/view/render/cameracontroller.cpp
# apps/opencs/view/render/cameracontroller.hpp
This commit is contained in:
parent
342d31de76
commit
3a676fc456
3 changed files with 3 additions and 30 deletions
|
@ -3,12 +3,8 @@
|
|||
#include <QKeyEvent>
|
||||
|
||||
#include <osg/Camera>
|
||||
#include <osg/Geode>
|
||||
#include <osg/Group>
|
||||
#include <osg/Matrixd>
|
||||
#include <osg/Quat>
|
||||
#include <osg/Shape>
|
||||
#include <osg/ShapeDrawable>
|
||||
|
||||
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<osg::Box> box = new osg::Box(osg::Vec3f(0, 0, 0), boxWidth);
|
||||
osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(box);
|
||||
drawable->setColor(osg::Vec4f(0.f, 0.9f, 0.f, 1.f));
|
||||
|
||||
osg::ref_ptr<osg::Geode> geode = new osg::Geode();
|
||||
geode->addChild(drawable);
|
||||
mCenterNode->addChild(geode);
|
||||
}
|
||||
|
||||
void OrbitCameraController::rotateHorizontal(double value)
|
||||
{
|
||||
osg::Vec3d eye, center, up;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <string>
|
||||
|
||||
#include <osg/BoundingBox>
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
#include <osg/ref_ptr>
|
||||
#include <osg/Vec3d>
|
||||
|
||||
|
@ -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<osg::PositionAttitudeTransform> mCenterNode;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ SceneWidget::SceneWidget(boost::shared_ptr<Resource::ResourceSystem> resourceSys
|
|||
, mPrevMouseX(0)
|
||||
, mPrevMouseY(0)
|
||||
, mFreeCamControl(new FreeCameraController())
|
||||
, mOrbitCamControl(new OrbitCameraController(mRootNode))
|
||||
, mOrbitCamControl(new OrbitCameraController())
|
||||
, mCurrentCamControl(mFreeCamControl.get())
|
||||
, mCamPositionSet(false)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue