Sign in to follow this  
esaint

Springs and vehicles in 2 dimensions

Recommended Posts

I need to create a preliminary demo of my 2D rigid body physics engine, and i was hoping to create a simple car driving over some terrain. I was thinking of doing this by using simple springs to attach two wheels (circles) to an OBB body of the car, since the engine does not handle any constraints (other than nonpenetration) yet. I have only played around with it so far, but it didn't work out at all. Either the strings were too tight and messed up the rest of the movement or they weren't strong enough- and the wheels went haywire. Is this even a good idea or should I just drop it and have single rigid bodies working independently until I have the time to write a decent constraint solver? Or am I just going about the springs the wrong way, is there a good paper on the subject somewhere? Or is there some other way I could do this?

Share this post


Link to post
Share on other sites
Springs are difficult. They are sometimes desirable for some effects. Verlet time integration may work better than what you're using. But they are still difficult and make stability hard to achieve. No matter what integrator you use, you'll probably want to add damping to each spring. Explicit Euler is generally a super bad idea when there are springs (and in general). Another possibility is to use an implicit integrator, which is a bit harder than explicit methods. (This may seem cryptic depending on your background. I don't feel like doing a super intuitive writeup right now.)

Share this post


Link to post
Share on other sites
Thanks Graham. I actually did try a few other integration methods (verlet among them) but other parts of the system (mainly the collisions) suffered, so it didn't seem worth it. I'll just take your advice and count out springs as a solution for the moment.

Thanks John, and I can't believe I missed that demo =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this