Skip to content

Commit

Permalink
fixed stuttering when moving objects in terrain editor
Browse files Browse the repository at this point in the history
  • Loading branch information
tritonas00 committed Dec 3, 2021
1 parent 00a9ab9 commit da4b2ed
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,18 +813,18 @@ int main(int argc, char *argv[])

if (App::app_state->getEnum<AppState>() == AppState::SIMULATION)
{
if (App::sim_state->getEnum<SimState>() != SimState::EDITOR_MODE )
{
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)
{
App::GetGameContext()->UpdateSkyInputEvents(dt);
App::GetSimTerrain()->GetTerrainEditor()->UpdateInputEvents(dt);
}
else if (App::sim_state->getEnum<SimState>() == SimState::RUNNING)
else
{
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::RUNNING)
{
if (App::GetCameraManager()->GetCurrentBehavior() != CameraManager::CAMERA_BEHAVIOR_FREE)
{
Expand Down

0 comments on commit da4b2ed

Please # to comment.