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

next_frame_integration consumes force value even when dt = 0 #96

Open
trsoluti opened this issue Sep 1, 2020 · 0 comments
Open

next_frame_integration consumes force value even when dt = 0 #96

trsoluti opened this issue Sep 1, 2020 · 0 comments
Assignees

Comments

@trsoluti
Copy link
Collaborator

trsoluti commented Sep 1, 2020

next_frame_integration, when creating the new velocity value, takes the forces (ForceAccumulator and gravity) and then multiplies them by the delta-time to get the resulting velocity.

Gravity is constant, so it is unaffected if the delta-time is 0.

However, next_frame_integration consumes the value in ForceAccumulator, so there's no force left once time starts up.

Instead, the system should treat delta-time==0 as a full stop, with no effect on any value.

This allows you to start an object moving from the beginning of the game, by applying force when setting up the object.

It also allows you to properly pause the physics by setting dt to 0.

@trsoluti trsoluti self-assigned this Sep 1, 2020
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