Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. [Quaternion to Euler Angles]
QtWS25 Last Chance

[Quaternion to Euler Angles]

Scheduled Pinned Locked Moved Solved Qt 6
7 Posts 3 Posters 642 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Erija
    wrote on 25 Mar 2022, 14:03 last edited by
    #1

    Hey,

    I tried to convert a quaternion to Euler angle using: void QQuaternion::getEulerAngles(float *pitch, float *yaw, float *roll) const

    However, I got this error: cannot initialize a parameter of type 'float *' with an lvalue of type 'float'

    This is the code line: quaternion.getEulerAngles(pitch,yaw,roll).

    Can you please help me ?

    A 1 Reply Last reply 25 Mar 2022, 14:08
    0
    • E Erija
      25 Mar 2022, 14:03

      Hey,

      I tried to convert a quaternion to Euler angle using: void QQuaternion::getEulerAngles(float *pitch, float *yaw, float *roll) const

      However, I got this error: cannot initialize a parameter of type 'float *' with an lvalue of type 'float'

      This is the code line: quaternion.getEulerAngles(pitch,yaw,roll).

      Can you please help me ?

      A Offline
      A Offline
      artwaw
      wrote on 25 Mar 2022, 14:08 last edited by
      #2

      @Erija said in [Quaternion to Euler Angles]:

      cannot initialize a parameter of type 'float *' with an lvalue of type 'float'

      Method expects pointers to float, you gave it just float.

      For more information please re-read.

      Kind Regards,
      Artur

      1 Reply Last reply
      2
      • E Offline
        E Offline
        Erija
        wrote on 25 Mar 2022, 14:46 last edited by
        #3

        I gave it a pointer and still get an error: expected '(' for function-style cast or type construction. :((

        A 1 Reply Last reply 25 Mar 2022, 14:47
        0
        • E Erija
          25 Mar 2022, 14:46

          I gave it a pointer and still get an error: expected '(' for function-style cast or type construction. :((

          A Offline
          A Offline
          artwaw
          wrote on 25 Mar 2022, 14:47 last edited by
          #4

          @Erija can you please post the block of code that causes the problem?

          For more information please re-read.

          Kind Regards,
          Artur

          1 Reply Last reply
          1
          • E Offline
            E Offline
            Erija
            wrote on 25 Mar 2022, 14:58 last edited by
            #5

            okay,
            Here it is;
            quaternion.getEulerAngles(float *pitch,float *yaw,float *roll);

            J 1 Reply Last reply 25 Mar 2022, 15:06
            0
            • E Erija
              25 Mar 2022, 14:58

              okay,
              Here it is;
              quaternion.getEulerAngles(float *pitch,float *yaw,float *roll);

              J Offline
              J Offline
              JonB
              wrote on 25 Mar 2022, 15:06 last edited by JonB
              #6

              @Erija
              That is not legal C/C++. Declare variables [I think you have done this], set them to the values you want to pass [I think you have done this], pass them as pointers via &variable.

              1 Reply Last reply
              1
              • E Offline
                E Offline
                Erija
                wrote on 28 Mar 2022, 16:13 last edited by
                #7

                Thank you all.
                Problem solved.

                1 Reply Last reply
                0

                1/7

                25 Mar 2022, 14:03

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved