Search Unity

Unity.Mathematics.quaternion

Discussion in 'Data Oriented Technology Stack' started by vallar_ultra, May 29, 2020.

  1. vallar_ultra

    vallar_ultra

    Joined:
    Jan 11, 2015
    Posts:
    3
    Hi! I'm start to learn Unity DOTS and found some strange behavior of quaternion structure: results of execution
    Unity.Mathematics.quaternion.Euler and regular UnityEngine.Quaternion.Euler is different.
    For example:
    Code (CSharp):
    1.            
    2.             //quaternion(0f, 0f, -0.9589243f, 0.2836622f)
    3.             Debug.Log(Unity.Mathematics.quaternion.Euler(0, 0, 10));
    4.  
    5.             //(0.0, 0.0, 0.1, 1.0)
    6.             Debug.Log(UnityEngine.Quaternion.Euler(0, 0, 10));
    7.  
    When i'm trying to use Unity.Mathematics.quaternion - i had get a strange angles. How it's work and where i can find info about using euler angles and Unity.Mathematics.quaternion structure?
     
  2. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    608
    In Unity.Mathematics angles are in radians, while in UnityEngine angles are in degrees.
     
    vallar_ultra likes this.
  3. vallar_ultra

    vallar_ultra

    Joined:
    Jan 11, 2015
    Posts:
    3
    Thanks! Now it works!
     
    brunocoimbra likes this.
unityunity