Code: Select all
myMotionState->m_graphicsWorldTrans.getBasis().getEulerZYX(z, y, x);
The problem I have is when the rotation is around 180 degrees, the value just switches between -180 and 180. As can be seen from some debugging info I'm recording for a mesh - the rotation x, y and z values are the three values after the rotation id.
Code: Select all
mesh016,4.74,rotation018,-179.999,58.1703, 179.999,translation019,-2.88586,0.500995,-0.94595
mesh016,4.76,rotation018,-180.000,58.1704, 180.000,translation019,-2.88586,0.500997,-0.945943
mesh016,4.78,rotation018,-180.000,58.1704, 180.000,translation019,-2.88586,0.500998,-0.945935
mesh016,4.80,rotation018, 180.000,58.1704, 180.000,translation019,-2.88586,0.500998,-0.945928
mesh016,4.82,rotation018, 180.000,58.1703, 180.000,translation019,-2.88586,0.500999,-0.945931
mesh016,4.84,rotation018, 180.000,58.1703, 180.000,translation019,-2.88586,0.500999,-0.945929
mesh016,4.86,rotation018,-179.989,58.1705,-179.993,translation019,-2.88584,0.501003,-0.945927
mesh016,4.88,rotation018,-179.996,58.1705,-179.997,translation019,-2.88583,0.501001,-0.945917
mesh016,4.90,rotation018,-179.997,58.1705,-179.998,translation019,-2.88584,0.501001,-0.945909
mesh016,4.92,rotation018,-179.997,58.1705,-179.998,translation019,-2.88584,0.501001,-0.945907
mesh016,4.94,rotation018,-179.998,58.1705,-179.998,translation019,-2.88584,0.501,-0.945899
mesh016,4.96,rotation018,-179.998,58.1705,-179.999,translation019,-2.88585,0.501,-0.945892
mesh016,4.98,rotation018,-179.999,58.1705,-179.999,translation019,-2.88585,0.501,-0.945884
mesh016,5.00,rotation018,-179.999,58.1705,-179.999,translation019,-2.88585,0.501,-0.945877
Many thanks
James.