Camera reset now every time cell object->view is pressed.

pull/34/head
LohikaarmeHav 9 years ago
parent 3030cc2d3a
commit c6ec473280

@ -810,6 +810,7 @@ if (APPLE)
set(\${default_embedded_path_var} \"\${path}\" PARENT_SCOPE)
endif()
endfunction()
cmake_policy(SET CMP0009 OLD)
fixup_bundle(\"${INSTALLED_OPENMW_APP}\" \"${PLUGINS}\" \"\")
fixup_bundle(\"${INSTALLED_OPENCS_APP}\" \"${OPENCS_PLUGINS}\" \"\")

@ -38,7 +38,9 @@ namespace CSMWorld
/// \note The worldspace part of \a id is ignored
static std::pair<CellCoordinates, bool> fromId (const std::string& id);
/// \return cell coordinates such that given world coordinates are in it.
static std::pair<int, int> coordinatesToCellIndex (float x, float y);
};
bool operator== (const CellCoordinates& left, const CellCoordinates& right);

@ -17,6 +17,7 @@
#include "editmode.hpp"
#include "mask.hpp"
#include "cameracontroller.hpp"
bool CSVRender::PagedWorldspaceWidget::adjustCells()
{
@ -477,12 +478,15 @@ void CSVRender::PagedWorldspaceWidget::useViewHint (const std::string& hint)
{
char ignore1; // : or ;
char ignore2; // #
// Current coordinate
int x, y;
// Loop throught all the coordinates to add them to selection
while (stream >> ignore1 >> ignore2 >> x >> y)
selection.add (CSMWorld::CellCoordinates (x, y));
/// \todo adjust camera position
// Setup camera
mCurrentCamControl->setup(mRootNode, Mask_Reference | Mask_Terrain, CameraController::WorldUp);
}
}
else if (hint[0]=='r')

@ -83,6 +83,8 @@ namespace CSVRender
virtual ~PagedWorldspaceWidget();
/// \brief Decodes the the hint string to set of cell that are rendered.
/// Calculates avarage of cell's coordinates to be new camera location.
void useViewHint (const std::string& hint);
void setCellSelection(const CSMWorld::CellSelection& selection);

@ -31,7 +31,6 @@ RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f)
, mRootNode(0)
{
osgViewer::CompositeViewer& viewer = CompositeViewer::get();
osg::DisplaySettings* ds = osg::DisplaySettings::instance().get();
@ -314,15 +313,7 @@ void SceneWidget::keyReleaseEvent (QKeyEvent *event)
void SceneWidget::update(double dt)
{
if (mCamPositionSet)
{
mCurrentCamControl->update(dt);
}
else
{
mCurrentCamControl->setup(mRootNode, Mask_Reference | Mask_Terrain, CameraController::WorldUp);
mCamPositionSet = true;
}
mCurrentCamControl->update(dt);
}
void SceneWidget::settingChanged (const CSMPrefs::Setting *setting)

@ -121,9 +121,6 @@ namespace CSVRender
std::map<std::pair<Qt::MouseButton, bool>, std::string> mButtonMapping;
private:
bool mCamPositionSet;
public slots:
void update(double dt);

Loading…
Cancel
Save