Skip to content

Commit

Permalink
time spring dampened transition mode would judder when changing camer…
Browse files Browse the repository at this point in the history
…a controllers
  • Loading branch information
loveridge authored and lhog committed Nov 24, 2024
1 parent a624c17 commit 306a5db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rts/Game/CameraHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ void CameraTransitionTimedSpringDampened(const CCameraController* currCam, CCame
} else if (nsecs > 0.0f) {
camTransState.timeEnd = nsecs * 1000.0f * camTransState.timeFactor;
camTransState.timeStart = nsecs * 1000.0f * camTransState.timeFactor;
camTransState.startPos = camera->GetPos();
camTransState.startRot = camera->GetRot();
camTransState.startFOV = camera->GetVFOV();
}
}

Expand Down Expand Up @@ -556,7 +559,6 @@ void CCameraHandler::SetCameraMode(unsigned int newMode)
currCamCtrlNum = newMode;
return;
}
CameraTransition(1.0f);

CCameraController* oldCamCtrl = camControllers[ oldMode];
CCameraController* newCamCtrl = camControllers[currCamCtrlNum = newMode];
Expand All @@ -567,6 +569,7 @@ void CCameraHandler::SetCameraMode(unsigned int newMode)

newCamCtrl->SwitchTo(oldCamCtrl);
newCamCtrl->Update();
CameraTransition(1.0f);
}

void CCameraHandler::SetCameraMode(const std::string& modeName)
Expand Down

0 comments on commit 306a5db

Please sign in to comment.