1
\$\begingroup\$

What is the theory behind creating a generic 3D vehicle in a physics engine?

What I would like to know is what parts should I stick together to make the vehicle, how they parts should stick together, and how to make the vehicle have the feel and movement of what you expect of a vehicle.

I'm not looking for any code, or how to do it with a specific engine. Just the theory behind how it is done.

\$\endgroup\$

closed as too broad by MichaelHouse Feb 9 '14 at 14:03

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ Please add details to narrow the scope of the question. Motion? Collisions? Mesh deformation? Lots of physics related to vehicles. \$\endgroup\$ – MichaelHouse Feb 9 '14 at 14:06
  • \$\begingroup\$ @Byte56 Edited. \$\endgroup\$ – Caesar Feb 9 '14 at 20:22
  • \$\begingroup\$ This is an interesting question, but so broad that I can't imagine an answer shorter than a book. Different games will also typically want a different complexity tradeoffs. There's no One Way to build a car. \$\endgroup\$ – Anko Feb 9 '14 at 20:55
  • 1
    \$\begingroup\$ You could edit more your question to include what is your process of thought. Have you been thinking of something already? What's your progress and why do you think it does not work? I've been working on a couple of simulated vehicles and the could not have been "generic". Why are you asking this question? Be specific so we can help you the best we can! \$\endgroup\$ – Alexandre Vaillancourt Feb 9 '14 at 21:02
  • \$\begingroup\$ @Anko Please don't look into this question too much. I don't want a create anything special. Just a simple vehicle that acts like what you would expect from a vehicle. Something like Alexandre Vaillancourt answer is spot on. \$\endgroup\$ – Caesar Feb 9 '14 at 21:16
2
\$\begingroup\$

The only physics engine I know is ODE so I'll roughly explain how would go with an engine like this one. I think this here could also be applied to something like bullet physics.

So, since your question is quite vague, here is something to start with:

One has first to determine what are the basic parts of the vehicle:

  • four wheels, represented conceptually by cylinders
  • the car, represented conceptually by a box

Then how are these items held together?

  • a hinge holding each of the rear wheels to the car
  • a hinge-2 holding each of the front wheels to the car

A hinge-2 is a hinge that has 2 axes, and is the type used to link front wheel to a car : it allows the wheel to roll on the road and it allows it turn in the direction it wants to go.

Obviously, these hinges have parameters: wheels don't have limits when they roll on the road, but the front wheels can't turn at 360 degrees.

Then, depending on the behaviour you want to achieve, you'll have to set the front wheels or the rear wheels - or all of them - as motors (or as brakes).

You'll have to tune the friction parameters between your wheels bodies and your "ground" bodies to get the behaviour you'll need.

And finally, each frame of your simulation, you'll have to set the the maximum force to apply on each hinge and the requested speed.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.