diff --git a/apps/opencs/view/render/pagedworldspacewidget.cpp b/apps/opencs/view/render/pagedworldspacewidget.cpp index 3baf4e972..d206c43b6 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.cpp +++ b/apps/opencs/view/render/pagedworldspacewidget.cpp @@ -485,8 +485,8 @@ void CSVRender::PagedWorldspaceWidget::useViewHint (const std::string& hint) while (stream >> ignore1 >> ignore2 >> x >> y) selection.add (CSMWorld::CellCoordinates (x, y)); - // Setup camera - mCurrentCamControl->setup(mRootNode, Mask_Reference | Mask_Terrain, CameraController::WorldUp); + // Mark that camera needs setup + mCamPositionSet=false; } } else if (hint[0]=='r') diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index ef5b8959b..1ebc5c3e7 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -160,6 +160,7 @@ SceneWidget::SceneWidget(boost::shared_ptr resourceSys , mFreeCamControl(new FreeCameraController()) , mOrbitCamControl(new OrbitCameraController()) , mCurrentCamControl(mFreeCamControl.get()) + , mCamPositionSet(false) { mOrbitCamControl->setPickingMask(Mask_Reference | Mask_Terrain); selectNavigationMode("free"); @@ -312,7 +313,15 @@ void SceneWidget::keyReleaseEvent (QKeyEvent *event) void SceneWidget::update(double dt) { - mCurrentCamControl->update(dt); + if(mCamPositionSet) + { + mCurrentCamControl->update(dt); + } + else + { + mCurrentCamControl->setup(mRootNode, Mask_Reference | Mask_Terrain, CameraController::WorldUp); + mCamPositionSet = true; + } } void SceneWidget::settingChanged (const CSMPrefs::Setting *setting) diff --git a/apps/opencs/view/render/scenewidget.hpp b/apps/opencs/view/render/scenewidget.hpp index c36c57e4e..e21599373 100644 --- a/apps/opencs/view/render/scenewidget.hpp +++ b/apps/opencs/view/render/scenewidget.hpp @@ -118,6 +118,7 @@ namespace CSVRender std::auto_ptr mFreeCamControl; std::auto_ptr mOrbitCamControl; CameraController* mCurrentCamControl; + bool mCamPositionSet; std::map, std::string> mButtonMapping;