Fix issues with camera
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user