Skip to content
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

Fix render events to pass correct dt values #57

Closed
fenomas opened this issue Jul 2, 2019 · 1 comment
Closed

Fix render events to pass correct dt values #57

fenomas opened this issue Jul 2, 2019 · 1 comment

Comments

@fenomas
Copy link
Owner

fenomas commented Jul 2, 2019

beforeRender and afterRender events (from noa object) currently pass a dt argument equal to the number of ms elapsed since the last tick. This was done because the physics system needs that info, but general event consumers would expect dt to be the ms since the previous event.

As part of fix, add new noa.positionInCurrentTick property, which gets updated before each tick. That is, if noa.positionInCurrentTick is 0.25, then at the time of that render event the time since the last tick would be 1/4 of the noa._tickRate.

@fenomas
Copy link
Owner Author

fenomas commented Jul 18, 2019

This is fixed in the dev branch as of a week or two ago.

@fenomas fenomas closed this as completed Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant