[ODE] stepfast beta 2
David Whittaker
david at csworkbench.com
Sun Apr 13 23:48:01 2003
Hey everyone,
I've just put a new version of the iterative solver at
http://www.csworkbench.com/stepfast.zip . Stick that in your ode
directory and unzip it to replace Makefile, include/ode/objects.h,
ode/src/stepfast.h, ode/src/stepfast.cpp, and ode/test/test_crash.cpp with
the newest version. (No changes were made to the Makefile if you already
merged the last version with yours, but objects.h did change... two new
public functions).
Two new public functions were added:
void dWorldSetAutoEnableDepth(dWorldID world, int depth);
int dWorldGetAutoEnableDepth(dWorldID world);
These functions set and get the AutoEnableDepth, which is defined as the
maximum depth to search through disabled bodies when creating islands.
Let me explain that a little better. Say you're running the car into the
wall of disabled bodies. At first contact of the enabled car to the
disabled blocks, it will create a circle of radius (AutoEnableDepth) of
enabled bodies around where the car hit. Next step, that circle will
expand by another (AutoEnableDepth) on all sides, until the whole wall is
enabled. If you want the exact same functionality as before, set this to
A Really Big Number. If you want disabled bodies to act like geoms with
no body, set it to zero. AutoEnableDepth is designed to work in
conjunction with your own disabling code so that only the bodies that need
to be disabled are disabled at any given point in time. I'll get some
auto-disabling code in there once I get the physics working on everybody's
computer first. (If you're looking in the code, you'll notice I
implemented the AutoEnableDepth as a global variable instead of a member
of the dxWorld class.... this is only temporary, I'll change it when I add
the auto-disabling code).
Of some interest may be the changes to the car in test_crash. It has a
much better turning system (both front and back wheels turn around their
first (z) axis). It also has some anti-flip-over properties, which I
implemented by dropping another body below the main chassis and connecting
it by a fixed joint. The first method I tried, with a GeomTransform and
only one body, was more susceptible to inaccuracies (manifested by side to
side wheel motion) due to the fact that the chassis body was so far from
(and not in line with) the wheel bodies. Adding the extra body (with no
geom) and joint resolved those issues at the cost of an insignificantly
small speed hit. I have seen these two issues come up on the list enough
that I thought it would be good to have an example in a test program.
Also, you can reset the simulation (still on test_crash if I lost you) at
any time by pressing 'r'. You can also increase and decrease the
AutoEnableDepth on the fly by pressing '+' and '-'.
I haven't had a chance to test it in MSVC yet, so if you still have
trouble with it, let me know, and I'll switch over to Windows and see what
I can figure out.
David Whittaker