Commit 7c7349d1 authored by stoutjesdijk's avatar stoutjesdijk 🎧
Browse files

revert Quat2Euler x-z swap

parent 89d2564b
Loading
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -196,15 +196,9 @@ void Quat2Euler(
{
    if ( quat.w != -3.0 )
    {
#ifdef FIX_I109_ORIENTATION_TRACKING
        *roll = atan2f( 2 * ( quat.w * quat.x + quat.y * quat.z ), 1 - 2 * ( quat.x * quat.x + quat.y * quat.y ) );
        *pitch = asinf( 2 * ( quat.w * quat.y - quat.z * quat.x ) );
        *yaw = atan2f( 2 * ( quat.w * quat.z + quat.x * quat.y ), 1 - 2 * ( quat.y * quat.y + quat.z * quat.z ) );
#else // bug: x and z swapped
        *yaw = atan2f( 2 * ( quat.w * quat.x + quat.y * quat.z ), 1 - 2 * ( quat.x * quat.x + quat.y * quat.y ) );
        *pitch = asinf( 2 * ( quat.w * quat.y - quat.z * quat.x ) );
        *roll = atan2f( 2 * ( quat.w * quat.z + quat.x * quat.y ), 1 - 2 * ( quat.y * quat.y + quat.z * quat.z ) );
#endif
    }
    else
    {