-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Add units to VehicleWheel3D suspension stiffness and damping #94862
Add units to VehicleWheel3D suspension stiffness and damping #94862
Conversation
152cd25
to
cb44114
Compare
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.
Tiny changes, seem correct
cb44114
to
c2152a5
Compare
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.
Looks good to me.
It seems way overkill to me to list units both in I think we should pick one standard and stick with it. AFAIK So I would stick to only the Unless it is commonly established to use |
c2152a5
to
e3895e0
Compare
Thanks! |
Minor PR. In master VehicleWheel3D's suspension stiffness does not have its units documented, this PR fixes that.
The metric/SI unit for suspension stiffness is kg/s² or N/m. However, the values for typical cars are usually between 20,000 and 200,000, so it's common to use Mg/s² or N/mm instead to bring the range of values down to between 20 and 200. This is what Godot uses. The documentation already recommends values around 50, 100, and 200 depending on the type of car, and these are the values that produce sane results in testing.
Similarly, the metric/SI unit for suspension damping is kg/s or N⋅s/m. Typical values are in the hundreds, but Godot works with values between 0 and 1, so it is using Mg/s or N⋅s/mm instead.
Here is what it looks like in the inspector:
EDIT: I temporarily marked this PR as draft because 1) I looked at the code and did not see where any conversion factor of 1000 was taking place and 2) I realized that the cars in Truck Town may be misleading me due to their low mass (40kg vs a real car's 1000 to 2000 kg). However, I did some more testing, even with a car of higher mass more like a realistic car, values in N/mm produced much better results than trying to put in numbers in the tens of thousands. So I'm highly confident that N/mm is correct, even though I can't find where in the code this is determined.