Fix issues with camera

This commit is contained in:
Georg Hagen
2024-06-30 13:58:11 +02:00
parent 475c72e505
commit beeea386aa
2 changed files with 5 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ namespace OpenVulkano::Scene
, m_animationDuration(1.0f)
, m_currentTime(0.0f)
, m_isMorphing(false)
, m_targetMorphStatePerspective(false)
, m_targetMorphStatePerspective(true)
{
auto input = OpenVulkano::Input::InputManager::GetInstance();
m_actionMorph = input->GetAction("morph");
@@ -52,13 +52,14 @@ namespace OpenVulkano::Scene
t = 1.0f;
m_isMorphing = false;
}
float newState = m_targetMorphStatePerspective ? t : (1.0f - t);
float newState = m_targetMorphStatePerspective ? (1.0f - t) : t;
static_cast<MorphableCamera*>(GetCamera())->SetMorphState(newState);
}
}
void MorphableCameraController::SetTargetState(bool toPerspective)
{
if (toPerspective == m_targetMorphStatePerspective) return;
m_targetMorphStatePerspective = toPerspective;
m_isMorphing = true;
}