Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-93600

90° X rotation as quaternion produces NaN on euler angle

    XMLWordPrintable

Details

    • Linux/X11
    • 3
    • 7ea2fbddcf674d49ad7d219cdb8a4b760258360c (qt/qtbase/dev) 98fcf3cb611fe895e6998726ae39bdd30512c98b (qt/qtbase/6.0) 4a8aa7f62c0bdac5c3d745d7836fac357f2cb2ce (qt/qtbase/6.1) 0db1c949ecf6638b13d1d0c540365051e03b8e08 (qt/tqtc-qtbase/5.15)

    Description

      A node with rotation set to Qt.quaternion(0.707107,0.707107,0,0) will give an eulerRotation of QVector3D(nan, 0, 0).

      The problem occurs with +/-0.707107 on X axis but not on Y or Z axis.

      Any other value did not produce error

       

      How to reproduce :

          Model {
              rotation: Qt.quaternion(0.707107,0.707107,0,0)
              Component.onCompleted: {
                  console.log(rotation + "\t" + eulerRotation)
              }
          }

       

      UPDATE :

      The issue is not with QML but with QQuaternion class. We can test it with

          QQuaternion q = QQuaternion(0.707107,-0.707107,0,0);
          std::cout << q.toEulerAngles().x() << "\n";
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              inho Inho Lee
              philemong Philémon Giraud
              Votes:
              10 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes