-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Update damping values for jolt rigid bodies on mode switch at runtime #100473
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed a bug, and the fix is the appropriate one. I only have some minor change requests.
Also, since it'll probably get brought up eventually, note that Godot's contribution workflow (seen here) specifies that pull requests should ideally be a single commit, so you'll need to squash (and force push) your commits yourself before the PR can be merged. |
But there's no need to squash yet only when it's actually approved and ready to merge |
7d4fb36
to
0dd072b
Compare
Thanks! Congratulations on your first merged contribution! 🎉 |
Hi there 👋
Here's a fix for an issue where linear_damp and angular_damp are not updated when either linear_damp_mode or angular_damp_mode is changed at runtime.
Previously, linear_damp and angular_damp were computed once using their initial damping mode and not updated whenever a mode was changed.
It's likely that we want to split that update operation for each damping type.
I've made a short demo, cube A and B are the same but they change their linear damping mode when they collide with a floor surface, the red one changes the mode to REPLACE while the blue one changes the mode to COMBINE.
The initial mode is COMBINE for both and they have the same initial velocity in opposite directions.
The default linear damping value is
.5
.damping.mp4
Here's the same demo without the fix (which means damping is not updated when cube A damping mode is changed when it first collides with the red surface)
damped.mp4