Skip to content

Commit

Permalink
update character before CameraManager
Browse files Browse the repository at this point in the history
  • Loading branch information
tritonas00 committed Nov 5, 2021
1 parent b368d21 commit e6baad6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ int main(int argc, char *argv[])

if (App::app_state->getEnum<AppState>() == AppState::SIMULATION)
{
App::GetGameContext()->GetCharacterFactory()->Update(dt); // Character MUST be updated before CameraManager, otherwise camera position is always 1 frame behind the character position, causing stuttering.
App::GetCameraManager()->UpdateInputEvents(dt);
App::GetOverlayWrapper()->update(dt);
if (App::sim_state->getEnum<SimState>() == SimState::EDITOR_MODE)
Expand All @@ -821,7 +822,7 @@ int main(int argc, char *argv[])
}
else if (App::sim_state->getEnum<SimState>() == SimState::RUNNING)
{
App::GetGameContext()->GetCharacterFactory()->Update(dt);

if (App::GetCameraManager()->GetCurrentBehavior() != CameraManager::CAMERA_BEHAVIOR_FREE)
{
App::GetGameContext()->UpdateSimInputEvents(dt);
Expand Down

0 comments on commit e6baad6

Please # to comment.