Camera orbit bugfixes
This commit is contained in:
parent
c549cdcf42
commit
4bad61acec
|
@ -78,8 +78,8 @@ void CWaypointExtra::LinksModified()
|
||||||
|
|
||||||
void CWaypointExtra::AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo)
|
void CWaypointExtra::AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo)
|
||||||
{
|
{
|
||||||
// This call is necessary because if we try to build links in the constructor, it'll
|
// This call is necessary because if we try to build links in the constructor, it
|
||||||
// fail because we haven't finished loading the scene yet.
|
// won't work properly because we haven't finished loading the scene yet.
|
||||||
if (!mLinksBuilt) BuildLinks();
|
if (!mLinksBuilt) BuildLinks();
|
||||||
|
|
||||||
if (!ViewInfo.GameMode && mpParent->IsVisible() && !mpParent->IsSelected())
|
if (!ViewInfo.GameMode && mpParent->IsVisible() && !mpParent->IsSelected())
|
||||||
|
|
|
@ -113,9 +113,10 @@ void CSceneViewport::keyPressEvent(QKeyEvent* pEvent)
|
||||||
{
|
{
|
||||||
CBasicViewport::keyPressEvent(pEvent);
|
CBasicViewport::keyPressEvent(pEvent);
|
||||||
|
|
||||||
if (!pEvent->modifiers() && pEvent->key() == Qt::Key_Z)
|
if (!pEvent->modifiers() && pEvent->key() == Qt::Key_Z && !pEvent->isAutoRepeat())
|
||||||
{
|
{
|
||||||
mCamera.SetMoveMode(eOrbitCamera);
|
mCamera.SetMoveMode(eOrbitCamera);
|
||||||
|
emit CameraOrbit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +124,7 @@ void CSceneViewport::keyReleaseEvent(QKeyEvent* pEvent)
|
||||||
{
|
{
|
||||||
CBasicViewport::keyReleaseEvent(pEvent);
|
CBasicViewport::keyReleaseEvent(pEvent);
|
||||||
|
|
||||||
if (pEvent->key() == Qt::Key_Z)
|
if (pEvent->key() == Qt::Key_Z && !pEvent->isAutoRepeat())
|
||||||
{
|
{
|
||||||
mCamera.SetMoveMode(eFreeCamera);
|
mCamera.SetMoveMode(eFreeCamera);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void GizmoMoved();
|
void GizmoMoved();
|
||||||
|
void CameraOrbit();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void CheckUserInput();
|
void CheckUserInput();
|
||||||
|
|
|
@ -64,8 +64,9 @@ CWorldEditor::CWorldEditor(QWidget *parent) :
|
||||||
|
|
||||||
// Connect signals and slots
|
// Connect signals and slots
|
||||||
connect(ui->MainViewport, SIGNAL(GizmoMoved()), this, SLOT(OnGizmoMoved()));
|
connect(ui->MainViewport, SIGNAL(GizmoMoved()), this, SLOT(OnGizmoMoved()));
|
||||||
connect(ui->MainViewport, SIGNAL(GizmoMoved()), this, SLOT(UpdateCameraOrbit()));
|
connect(ui->MainViewport, SIGNAL(CameraOrbit()), this, SLOT(UpdateCameraOrbit()));
|
||||||
connect(this, SIGNAL(SelectionModified()), this, SLOT(UpdateCameraOrbit()));
|
connect(this, SIGNAL(SelectionModified()), this, SLOT(UpdateCameraOrbit()));
|
||||||
|
connect(this, SIGNAL(SelectionTransformed()), this, SLOT(UpdateCameraOrbit()));
|
||||||
connect(ui->TransformSpinBox, SIGNAL(ValueChanged(CVector3f)), this, SLOT(OnTransformSpinBoxModified(CVector3f)));
|
connect(ui->TransformSpinBox, SIGNAL(ValueChanged(CVector3f)), this, SLOT(OnTransformSpinBoxModified(CVector3f)));
|
||||||
connect(ui->TransformSpinBox, SIGNAL(EditingDone(CVector3f)), this, SLOT(OnTransformSpinBoxEdited(CVector3f)));
|
connect(ui->TransformSpinBox, SIGNAL(EditingDone(CVector3f)), this, SLOT(OnTransformSpinBoxEdited(CVector3f)));
|
||||||
connect(ui->CamSpeedSpinBox, SIGNAL(valueChanged(double)), this, SLOT(OnCameraSpeedChange(double)));
|
connect(ui->CamSpeedSpinBox, SIGNAL(valueChanged(double)), this, SLOT(OnCameraSpeedChange(double)));
|
||||||
|
|
|
@ -62,6 +62,7 @@ public:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void SelectionModified();
|
void SelectionModified();
|
||||||
|
void SelectionTransformed();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void OnGizmoMoved();
|
void OnGizmoMoved();
|
||||||
|
|
|
@ -27,6 +27,8 @@ CRotateNodeCommand::CRotateNodeCommand(INodeEditor *pEditor, const QList<CSceneN
|
||||||
rotate.newRot = pNode->LocalRotation();
|
rotate.newRot = pNode->LocalRotation();
|
||||||
mNodeList.push_back(rotate);
|
mNodeList.push_back(rotate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mpEditor->SelectionTransformed();
|
||||||
}
|
}
|
||||||
|
|
||||||
CRotateNodeCommand::~CRotateNodeCommand()
|
CRotateNodeCommand::~CRotateNodeCommand()
|
||||||
|
@ -78,6 +80,7 @@ void CRotateNodeCommand::undo()
|
||||||
}
|
}
|
||||||
|
|
||||||
mpEditor->RecalculateSelectionBounds();
|
mpEditor->RecalculateSelectionBounds();
|
||||||
|
mpEditor->SelectionTransformed();
|
||||||
mpEditor->UpdateGizmoUI();
|
mpEditor->UpdateGizmoUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +95,7 @@ void CRotateNodeCommand::redo()
|
||||||
}
|
}
|
||||||
|
|
||||||
mpEditor->RecalculateSelectionBounds();
|
mpEditor->RecalculateSelectionBounds();
|
||||||
|
mpEditor->SelectionTransformed();
|
||||||
mpEditor->UpdateGizmoUI();
|
mpEditor->UpdateGizmoUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ CScaleNodeCommand::CScaleNodeCommand(INodeEditor *pEditor, const QList<CSceneNod
|
||||||
scale.newScale = pNode->LocalScale();
|
scale.newScale = pNode->LocalScale();
|
||||||
mNodeList.push_back(scale);
|
mNodeList.push_back(scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mpEditor->SelectionTransformed();
|
||||||
}
|
}
|
||||||
|
|
||||||
CScaleNodeCommand::~CScaleNodeCommand()
|
CScaleNodeCommand::~CScaleNodeCommand()
|
||||||
|
@ -78,6 +80,7 @@ void CScaleNodeCommand::undo()
|
||||||
}
|
}
|
||||||
|
|
||||||
mpEditor->RecalculateSelectionBounds();
|
mpEditor->RecalculateSelectionBounds();
|
||||||
|
mpEditor->SelectionTransformed();
|
||||||
mpEditor->UpdateGizmoUI();
|
mpEditor->UpdateGizmoUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +95,7 @@ void CScaleNodeCommand::redo()
|
||||||
}
|
}
|
||||||
|
|
||||||
mpEditor->RecalculateSelectionBounds();
|
mpEditor->RecalculateSelectionBounds();
|
||||||
|
mpEditor->SelectionTransformed();
|
||||||
mpEditor->UpdateGizmoUI();
|
mpEditor->UpdateGizmoUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@ CTranslateNodeCommand::CTranslateNodeCommand(INodeEditor *pEditor, const QList<C
|
||||||
translate.newPos = pNode->LocalPosition();
|
translate.newPos = pNode->LocalPosition();
|
||||||
mNodeList.push_back(translate);
|
mNodeList.push_back(translate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mpEditor->SelectionTransformed();
|
||||||
}
|
}
|
||||||
|
|
||||||
CTranslateNodeCommand::~CTranslateNodeCommand()
|
CTranslateNodeCommand::~CTranslateNodeCommand()
|
||||||
|
@ -70,6 +72,7 @@ void CTranslateNodeCommand::undo()
|
||||||
translate.pNode->SetPosition(translate.initialPos);
|
translate.pNode->SetPosition(translate.initialPos);
|
||||||
|
|
||||||
mpEditor->RecalculateSelectionBounds();
|
mpEditor->RecalculateSelectionBounds();
|
||||||
|
mpEditor->SelectionTransformed();
|
||||||
mpEditor->UpdateGizmoUI();
|
mpEditor->UpdateGizmoUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +84,7 @@ void CTranslateNodeCommand::redo()
|
||||||
translate.pNode->SetPosition(translate.newPos);
|
translate.pNode->SetPosition(translate.newPos);
|
||||||
|
|
||||||
mpEditor->RecalculateSelectionBounds();
|
mpEditor->RecalculateSelectionBounds();
|
||||||
|
mpEditor->SelectionTransformed();
|
||||||
mpEditor->UpdateGizmoUI();
|
mpEditor->UpdateGizmoUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue