Skip to content

Conversation

@noahwagner04
Copy link

Bug Description

I took a look at the Body.update function and noticed that the time-corrected Verlet integration equation isn’t implemented correctly. Based on this Stack Overflow post, the acceleration needs to be multiplied by a time-corrected version of deltaTimeSquared.

Proposed Fix

This fix adjusts the Verlet integration calculation in Body.update by applying the correct time correction to the acceleration term. With this change, movement should be more accurate when deltaTime varies. All existing tests pass after this update.

Additional Notes

I’m not completely versed in the math behind the angular velocity calculations, so I haven’t applied a similar fix there. It might need a similar treatment, but I decided to leave that out for now until there’s more clarity on how to address it correctly.

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

Successfully merging this pull request may close these issues.

1 participant