[ODE] Newbie Question about AMotors...

Ary Setijadi Prihatmanto asetijadi at gmx.at
Mon Feb 2 21:37:24 MST 2004


Halo all,

sorry for (maybe) this stupid question.

I have tried to get euler angle information from ball joint through AMotor,
using
            dJointGetAMotorAngle(dJointID, int anum) command.
But it seems i just get a garbage number, a very big integer number.

this is a part of code :

1. for defining joint:
            balljoint  = dJointCreateBall(world->GetWorldID(), 0);
                dJointAttach(balljoint, body1->GetBodyID(),
body2->GetBodyID());
                dJointSetBallAnchor(balljoint, x, y,  z);

2. for defining AMotor
                balljointAMotor = dJointCreateAMotor(world->GetWorldID(),
0);
                dJointAttach(balljointAMotor, body1->GetBodyID(),
body2->GetBodyID());
                dJointSetAMotorNumAxes(balljointAMotor ,3);
                dJointSetAMotorAxis(balljointAMotor, 0, 1, 0,0,1);
                dJointSetAMotorAxis(balljointAMotor, 2, 2, 1,0,0);
                dJointSetAMotorMode(balljointAMotor, dAMotorEuler);
                dJointSetAMotorParam(balljointAMotor, dParamFMax, 0);

3. for getting joint angle:
            float pitch  = dJointGetAMotorAngle(balljointAMotor, 0)

4. And this is a sample of what I got for pitch: -30221568 (using printf
with %d )

Thank you in advance....
Ary




More information about the ODE mailing list