I have tried with several formulas, including the built-in one in Irrlicht, but it happens with all of them. Here is one:
Code: Select all
irrRotation.X = atan2(2. * (y * z + x * w), (-sqx - sqy + sqz + sqw)) * irr::core::RADTODEG;
irrRotation.Y = asin(-2. * (x * z - y * w)) * irr::core::RADTODEG;
irrRotation.Z = atan2(2. * (x * y + z * w), ( sqx - sqy - sqz + sqw)) * irr::core::RADTODEG;
Converted Euler: -73.2696 -90 82.7662
ODE Quaternion: 0.70468 0.0585334 -0.70468 0.0585334
113.891 -90 -104.395
0.70468 0.0585334 -0.70468 0.0585334
115.794 -90 -106.298
0.70468 0.0585334 -0.70468 0.0585334
89.6402 -90 -80.1436
0.70468 0.0585334 -0.70468 0.0585334
74.2572 nan -64.7606
0.70468 0.0585334 -0.70468 0.0585334
Does anyone know what could be causing this? And how to fix it?
Cheers.
EDIT: This only happens when the block has become still, when it's moving it is fine, but sometimes when it stops moving, this happens.