Editor: flag orbit camera for re-initialization

After swapping cells the orbit cam controller needs to be
re-initialized to properly center on the new cell.
pull/193/head^2
Rob Cutmore 8 years ago
parent f7664d4bb9
commit 84bad9316d

@ -632,6 +632,11 @@ namespace CSVRender
getCamera()->getViewMatrix().orthoNormal(getCamera()->getViewMatrix());
}
void OrbitCameraController::reset()
{
mInitialized = false;
}
void OrbitCameraController::onActivate()
{
mInitialized = false;

@ -159,6 +159,9 @@ namespace CSVRender
void update(double dt);
/// \brief Flag controller to be re-initialized.
void reset();
private:
void onActivate();

@ -15,6 +15,7 @@
#include "../widget/scenetooltoggle.hpp"
#include "../widget/scenetooltoggle2.hpp"
#include "cameracontroller.hpp"
#include "mask.hpp"
#include "tagbase.hpp"
@ -93,6 +94,7 @@ bool CSVRender::UnpagedWorldspaceWidget::handleDrop (const std::vector<CSMWorld:
mCell.reset (new Cell (getDocument().getData(), mRootNode, mCellId));
mCamPositionSet = false;
mOrbitCamControl->reset();
update();
emit cellChanged(*universalIdData.begin());

Loading…
Cancel
Save