[ODE] using ODE for 2D simulations

Benny Benny <benny at kramekweb.com>
Wed Sep 4 12:32:02 2002


I have been using ODE for a while and feel very comfortable with it. Thank
you again every one who's contributed to it.
I'm planning on making a 2d game, and wondering if ODE will work ok. Basicly
3 points I'd like to know more about:

1: How do I set the inertia matrix for a 2d body? I think(not sure at all),
that in 2d you only need the moment of intertia at the center of mass and
that it is a scalar. Is this correct? If so, then how do I fill in ODE's
inertia matrix?

2: If I only apply forces, torques, and joints to the x and y axes, will my
simulation run in 2d without drifting along the z axis because of floating
point rounding errors or some other reason?

3 (Most important): I'm concerned about the speed. Since ODE is meant for
3d, how much slower would it be than using a similar library that is
designed for 2d? (I'm talking only about the dynamics including collision
response, not including collision detection). I think that things like
vector addition doing 3 components instead of 2 won't make much of a
difference. I'm worried about the joints mostly. It is my understanding that
in 2d the math is much simpler.

Thank you,
Benny Kramek