Problem with euler.

Please don't post Bullet support questions here, use the above forums instead.
OSasuke
Posts: 47
Joined: Tue Dec 09, 2008 10:12 am

Problem with euler.

Post by OSasuke »

Hi,

I have some problems with the conversion to euler angles.
I created a box and apply an agular velocity.

This is my code for conversion :

Code: Select all

Body->setAngularVelocity(btVector3(0,1,0));
btTransform t;
Body->getMotionState()->getWorldTransform(t);
btMatrix3x3 m(t.getRotation());
btVector3 v;
m.getEulerYPR(v[0],v[1],v[2]);
//..
std::cout << v[0] << "," << v[1] << "," << v[2] << endl;
The problem is that the values are wrong.

I should have the following values :
X = 0
Y = [-180 ; 180] ( between -180 and 180 )
Z = 0


But i have this :
X = {0 ; 180} ( 0 or 180 )
Y = [-90 ; 90] ( between -90 and 90 )
Z = {0 ; 180} ( 0 or 180 )


Please, help me. :(