-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Rigidbody linear damping has non-intuitive behavior around 1.0 #19182
Comments
The damping seems applied correctly. I don't know if this is a feature or a bug. I need to open an issue to the Bullet Physics github to assert it |
From looking at the code, it seems damping is designed to be in the [0-1) range. Here's what it does in bullet: m_linearVelocity *= btPow(btScalar(1) - m_linearDamping, timeStep); So if your damping is 1, it should actually have no movement, and > 1 should... I guess move it backward? I guess the bigger problem is that you can't enter values with more than 2 decimal places, since it seems like you might need to have a really-close-to-1 value. I guess you could add a script to your object and set the value from that so you have more digits available? |
This partially addresses godotengine#19182.
This partially addresses godotengine#19182.
This partially addresses godotengine#19182.
Maybe damping should be exposed with a different scale? You need a ridiculous precision to be able to use a damping value as defined by the bullet equation:
|
Hello @erwincoumans, in the PR #37314 we are considering to change the damping behaviour in order to be more controllable. See: #19182 (comment) However, By reading this https://code.google.com/archive/p/bullet/issues/74 is possible to see that the formula was changed and it seems the cause of this weird behaviour. |
Damping us expected to be in the range [0..1], best closer to 0 not 1. I would implement custom damping in a pretick callback. Or just implement your own version behind an #ifdef, happy to add merge it in the Bullet repo (but leave default as-is, I don't want to break the API). |
@erwincoumans Thanks for the replay, Do you think it's expected this behavioural differences between a body with damping 0.99 and 1.0? We would expect something more smooth so would be useful understand if there is a problem or why it's expected to work as so. |
Godot version:
3.0.2 Mono
OS/device including version:
KDE Neon
Issue description:
When adjusting the linear damping of a rigid body in the range 0.98 to 1.02, the difference between 0.98 and 0.99 is marginal, but going from 0.99 to 1 suddenly causes a huge spike in the amount of dampening applied. Then going from 1 to 1.01 has a marginal effect again.
This is really annoying because for one of my projects, a damping on 0.99 was not enough, but a damping of 1.0 is way too much. There's no way to get a value inbetween. (0.999 is rounded to 1 in the editor)
This is using the
DEFAULT
physics engine, by the way.Demonstration:
Might be related: #14650
Steps to reproduce:
Minimal reproduction project:
dampingbug.zip
The text was updated successfully, but these errors were encountered: