-
Notifications
You must be signed in to change notification settings - Fork 23
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
vehicle acceleration depends on its location #13
Comments
I instrumented btRigidBody.cpp to print out the impulses applied during the timestep:
|
The difference is in
Tracing it back further, Testing for exact (in)equality of floating-point values is a red flag, due to the risk of round-off error. But which path/result is correct? |
It makes no physical sense for the scaling of the forward impulse to depend on whether the side impulse is exactly 0. I suspect that the test in line 612 of "btRaycastVehicle.cpp" was originally an optimization, perhaps at a time when the 2 impulses were calculated in separate loops. In that case, the coder who merged the loops overlooked the need to remove the test. Furthermore, the startup accelerations observed in More Advanced Vehicles seem more plausible with the smaller impulses, which is the result I expect from commenting out line 612. |
Committed stephengold/Libbulletjme@cbccdee Instead of spiking it in the end zone, I took celebratory screenshots. |
fixed in Minie 3.1.0 |
Submitted a PR to the bullet3 project: bulletphysics/bullet3#3220 |
In current More Advanced Vehicles (using Minie v3.0.0), vehicles occasionally accelerate much faster than they should. The issue is noticeable when accelerating from rest on a flat, horizontal surface.
I created a test app that reproduces the issue. Depending on the starting X and Z coordinates, the vehicle's Z velocity after a single simulation step can either be large (9.086558) or small (0.06497696). For starting coordinates uniformly distributed between 0 and 1, the outcome is approximately 18% large and 82% small. For fixed starting X and Z coordinates, however, the outcome seems to be highly repeatable.
The text was updated successfully, but these errors were encountered: