-
Notifications
You must be signed in to change notification settings - Fork 89
tweak(fps): Decouple logic time step from render update #1451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
8ef9d91
be00a02
90345aa
d2a6bf6
c92e7f9
20f00ce
1036d47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1883,26 +1883,30 @@ void InGameUI::update( void ) | |
layout->runUpdate(); | ||
} | ||
|
||
//Handle keyboard camera rotations | ||
if( m_cameraRotatingLeft && !m_cameraRotatingRight ) | ||
if (m_cameraRotatingLeft || m_cameraRotatingRight || m_cameraZoomingIn || m_cameraZoomingOut) | ||
{ | ||
//Keyboard rotate left | ||
TheTacticalView->setAngle( TheTacticalView->getAngle() - TheGlobalData->m_keyboardCameraRotateSpeed ); | ||
} | ||
if( m_cameraRotatingRight && !m_cameraRotatingLeft ) | ||
{ | ||
//Keyboard rotate right | ||
TheTacticalView->setAngle( TheTacticalView->getAngle() + TheGlobalData->m_keyboardCameraRotateSpeed ); | ||
} | ||
if( m_cameraZoomingIn && !m_cameraZoomingOut ) | ||
{ | ||
//Keyboard zoom in | ||
TheTacticalView->zoomIn(); | ||
} | ||
if( m_cameraZoomingOut && !m_cameraZoomingIn ) | ||
{ | ||
//Keyboard zoom out | ||
TheTacticalView->zoomOut(); | ||
// TheSuperHackers @tweak Decouples camera rotation and zoom from draw (aka render update) | ||
const Real logicTimeScaleOverFpsRatio = TheGameEngine->getActualLogicTimeScaleOverFpsRatio(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the camera zoom and rotate should be decoupled from the logic time scale as well. It should just always be the same speed unless the user changes some specific option for it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
const Real rotateAngle = TheGlobalData->m_keyboardCameraRotateSpeed * logicTimeScaleOverFpsRatio; | ||
const Real zoomHeight = 10.0f * logicTimeScaleOverFpsRatio; | ||
|
||
if( m_cameraRotatingLeft && !m_cameraRotatingRight ) | ||
{ | ||
TheTacticalView->setAngle( TheTacticalView->getAngle() - rotateAngle ); | ||
} | ||
else if( m_cameraRotatingRight && !m_cameraRotatingLeft ) | ||
{ | ||
TheTacticalView->setAngle( TheTacticalView->getAngle() + rotateAngle ); | ||
} | ||
|
||
if( m_cameraZoomingIn && !m_cameraZoomingOut ) | ||
{ | ||
TheTacticalView->zoom( -zoomHeight ); | ||
} | ||
else if( m_cameraZoomingOut && !m_cameraZoomingIn ) | ||
{ | ||
TheTacticalView->zoom( +zoomHeight ); | ||
} | ||
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify to just "from render update". Multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed