bugfix(camera): Advance scripted camera moves by elapsed logic time - #3143
Draft
bobtista wants to merge 1 commit into
Draft
bugfix(camera): Advance scripted camera moves by elapsed logic time#3143bobtista wants to merge 1 commit into
bobtista wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3142.
rotateCamera,zoomCameraandpitchCameraconvert their authored duration into a count of 33.33 ms frames, then advance one step per render frame, so a scripted camera move completesrenderFps / logicFpstimes faster than the mission scripter intended. Network games hit this without any special setup, becauseFramePacer::getActualLogicTimeScaleFps()returnsTheNetwork->getFrameRate()and pins the logic rate near 30 while the render rate follows the player's limit.Now advances the three movements by the elapsed logic time instead of by one render frame, so they take the authored duration at any render frame rate.
curFramebecomes aRealand accumulatesmilliseconds / TheW3DFrameLengthInMsec, which leaves the easing, the hold frames, and the remaining-time maths used bySet Final Zoom/Set Final Pitchworking on the same quantities as before.Measured with a "1 rotation over 2.00 seconds" move, logic time scale pinned at 30 FPS, varying only the max render FPS:
This mirrors the fix already applied to the fourth scripted camera movement in the same file: #1451 converted
moveAlongWaypointPathto accumulate elapsed milliseconds fed byTheFramePacer->getLogicTimeStepMilliseconds(FramePacer::IgnoreFrozenTime), and rotate, zoom and pitch were left on the old frame-counting form. The call sites here now pass the same value.W3DViewlives inCore, so this covers both games.Todo: