1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-11 09:36:37 +00:00
Preview seem to not like removing mCamPositionSet and I have do other things.
This commit is contained in:
LohikaarmeHav 2016-08-02 15:26:12 +03:00
parent c6bc30d6a8
commit 7cd991107c
3 changed files with 13 additions and 3 deletions

View File

@ -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')

View File

@ -160,6 +160,7 @@ SceneWidget::SceneWidget(boost::shared_ptr<Resource::ResourceSystem> 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)

View File

@ -118,6 +118,7 @@ namespace CSVRender
std::auto_ptr<FreeCameraController> mFreeCamControl;
std::auto_ptr<OrbitCameraController> mOrbitCamControl;
CameraController* mCurrentCamControl;
bool mCamPositionSet;
std::map<std::pair<Qt::MouseButton, bool>, std::string> mButtonMapping;