[ODE] Basic question about dBodyGetRotation() and 2D angles

John Klimek jklimek at gmail.com
Tue Oct 17 13:29:55 MST 2006


I'm trying to use ODE for 2D and I've been reading the example posted
on the Pop Cap forums.  I think my program ALMOST works but I'm having
a bit of trouble with the angles.

Here's what I'm doing:

const dReal* matrix;
matrix = dBodyGetRotation(myBody);

dReal angle = atan2(matrix[0], matrix[1]);

What I want is the Z angle of rotation.  I can't use Euler angles or
anything fancy.  My 2D graphics engine uses (0, 0) for the top-left
corner and whatever you specify for the bottom right corner (eg. 800,
600).

So can anybody help me out?

Thanks in advance!


More information about the ODE mailing list