Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Multiplying two quaternions, like two Quaternions

Discussion in 'Entity Component System' started by jashan, Sep 11, 2020.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Unity's capital-Q Quaternions have a multiply operator, so we can create the combined rotation from two rotations. I need to do the same thing in a job - but wasn't able to find something similar for Unity.Mathematics.quaternion.

    I tried math.mul(quaternion a, quaternion b), which seemed like the best bet. But that gives me the wrong rotation, regardless of order.

    Am I just missing something? This shouldn't be hard ...
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    math.mul
     
    jashan likes this.
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Cool, thank you! I have just realized that I had that component attached to the wrong entity. That's why math.mul gave me the "wrong" results.