Car Simulation Using the Open Dynamics Engine
I've put together a simple demo of a four-wheeled car using
the ODE dynamics engine and some rather crude
OpenGL graphics. It uses Hinge2 joints for the suspension, and
additionally adds friction, damping, sway bar, inner and outer
turn radius, and other controls to make the driving better and
make the car not immediately flip over.
Warning: This demo currently requires
GLSL support in your graphics card! It will crash if you don't
have it. Radeon 9500+ and GeForce FX 5200+ ought to work.
You can download the archive right here.
Full source code is available, too,
or you can just run the carworld.exe executable and drive around.
If you have a decent grahpics card, you can swap out the terrain
TGA file for a bigger area to drive on (and make your own!)
If you compile the source, you may need to find a copy of
libintroduce, or just comment out the small networking rudiments
that snuck into the source from another project. It's not actually
used by carworld.
The simulation loads .ASE files (Ascii Scene Export) from 3dsmax,
and by changing two lines in the content.cpp file, you can make it
load an arbitrary trimesh for your environment, rather than just a
height map. Note! It assumes that the Max System Unit is Centimeters,
and inside the engine, the units used are meters (so there's scaling
going on). If things come out too small, your system unit is probably
set to inches; scale everything by 2.56 and it'll work better.
Anyway, please feel free to drop me a line if you like it. All
the source (such as it is) is free software (as in beer!) under the
MIT license.
|