[ODE] fake car physics

Megan Fox shalinor at gmail.com
Sun Aug 7 12:04:09 MST 2005


(Most of these concepts can be found in "Carworld," an ODE demo that
was made to answer exactly this sort of question:
http://www.mindcontrol.org/~hplus/carworld.html)

If you want something like Unreal Tournament 2004's or GTA's vehicles,
all you need is a box with 4 rays being cast downard at each of the
four corners.  You simulate a spring system at each of the 4 rays,
simulate the friction of the "wheels", force application to the body
due to said frictions, and everything else - since you're in control
of everything, you can determine exactly how it behaves.

Ironically, it ends up being a lot more work to simulate a "fake" car
than a physically accurate car... but you kind of need to do most of
this work to make a nice-handling car anyways, and it's faster than a
full sim car.

Concepts of note include:

- anti-sway torque: as the body leans, you apply counter-torque to fix
the lean.  You can effectively disable roll-overs this way (just apply
unlimited counter-torque past a certain tilt point) if that's your
goal, and by controlling the torque application curve you can simulate
any number of easy or hard-to-rollover vehicles.

- center of mass: use dGeomTransform's to make your center of mass
somewhere low.  If you want a weeble-people car, you can displace it a
good deal below the ground even.

- turn stability: turning at high speeds can often cause rollovers in
a sim.  This is realistic, but unfun.  You can modify your max
correctional torque by the wheel turn to help eliminate this, but
still allow average "I just got T-boned" rollovers.  Incidentally,
this gives you GTA-esque "Steer into the lean to prevent just about
anything from rolling over, no matter how far it's tipped" physics,
which I find quite agreeable.

-Megan Fox

On 8/7/05, David Salz <david.salz at bitfield.de> wrote:
> Hi everyone,
> 
> I am currently working on an arcade-style racing game. I have experimented
> with ODE car physics quite a bit and find it rather difficult to achive the
> effect I need. Currently I use the "classic" setup with a box and four
> sphere as wheels. Getting this to work has been hard work so far - but it
> still does not drive as nicely as I want it to be :(
> 
> Several people here have mentioned doing car physics with a box and four
> rays - I wonder if this is a better approach for arcade-style games? Could
> someone please elaborate on how to do this or point me to an example? It
> still want to use ODE since the handling of collisions and obstacles works
> rather well.
> 
> When I say "arcade-style" I mean a game where the car is simply fun to
> drive, but does not behave physically correct - like in Need for Speed, for
> instance. Also also would like to "slide" on walls rather than bounce off.
> 
> David
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>



More information about the ODE mailing list