Skip to content

fix stepped rotation#4567

Merged
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix_stepped_rotation
Aug 20, 2022
Merged

fix stepped rotation#4567
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix_stepped_rotation

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

As part of the cleanup in preparation for model translation, there was a bit of code review that was actually incorrect. The calculation of the current step needs to be rounded down, because the step isn't actually complete until it fully reaches the next number. Rounding the step causes the submodel to jump around in all sorts of weird ways.

Follow-up to #4443.

@Goober5000 Goober5000 added the fix A fix for bugs, not-a-bugs, and/or regressions. label Aug 20, 2022

@BMagnu BMagnu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evidently this slipped past me in the last PR. Rounding down is obviously the correct thing to do.
explicitly flooring before casting to int is kind of doubling up for guaranteed positive numbers, but oh well

As part of the cleanup in preparation for model translation, there was a bit of code review that was actually incorrect.  The calculation of the current step needs to be rounded down, because the step isn't actually complete until it fully reaches the next number.  Rounding the step causes the submodel to jump around in all sorts of weird ways.

Follow-up to scp-fs2open#4443.
@Goober5000 Goober5000 force-pushed the fix_stepped_rotation branch from 899aaaf to 74112e1 Compare August 20, 2022 14:53
@Goober5000

Copy link
Copy Markdown
Contributor Author

That's true, the floor isn't technically needed here.

@Goober5000 Goober5000 merged commit 12227fd into scp-fs2open:master Aug 20, 2022
@Goober5000 Goober5000 deleted the fix_stepped_rotation branch August 20, 2022 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants