• Advertisement
Sign in to follow this  

friction and instability

This topic is 3871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing a physics engine for a game (university project). I was able to implement rigid body collisions and ground contact forces resolving, although it's not ideal. I use the Euler integrator. However, I have a little problem with friction. I needed to implement car physics and for that I calculated friction on the tires, etc. It works ok, but at small velocities the forces are too big and the velocities go back and forth on the +- sides. So the bodies get a little shaky. Increasing the frame rate doesn't help much. At 100 fps I can still see them shaking. I can't really make the forces smaller, as then the cars will slide off slopes, etc. I know that this must be a common problem, but couldn't really find any easy solutions. Can this be solved by tweaking the forces or adding some correcting factors? Or switching to 2nd order Euler or other integrators? I exactly know what the problem is, but cannot think of anything to solve it. Thanks, Michal.

Share this post


Link to post
Share on other sites
Advertisement
you could limit the force so that its never too large to do that, otherwise, you could check if the dot product with the previous velocity and current velocity is less than 0, which would imply its changed direction, and then set it to 0, or zero it in the plane its on if you know what i mean.

Share this post


Link to post
Share on other sites
Thanks, this is a nice interview, but doesn't really provide any solutions. Unless I'll go with the harmonic rods engine or something :).

To the previous poster: I tried zeroing the force when the velocity changes direction, but it didn't help much as in the next frame it would change direction anyway.

Zeroing the velocity is not an option, as I've got 4 tires and if I zero it at one of them, calculating the other 3 will make it nonzero again anyway.

Anyway, if I had a single point of contact I could binary search for a force that exactly zeroes the velocity and it would work great. But having 4 tires, I'd have to search a 4D space and I probably wouldn't find a solution anyway.

Maybe there is some iterative method similar to collision resolving ones, but I'm not advanced enough to come up with something like that.

Share this post


Link to post
Share on other sites
I hope you mean this integrator
va = va0 + a*dt
position = position0 + va*dt

If so you might compute it by your original way, and show smoothed results on the screen. (basically cancel that wobbling) The other way would be using symplectic six order integrator. Considering your function is cheap to evaluate, it would be slight slowdown. However high order integrators might hate discontinuities.

Are you using doubles? This should be computed in 64 bit precision.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement