Ejemplo n.º 1
0
        public GodotVector3 GetEuler()
        {
            GodotBasis   basis = Orthonormalized();
            GodotVector3 vector3;

            vector3.z = 0.0f;
            float num = basis.y[2];

            if (num < 1.0)
            {
                if (num > -1.0)
                {
                    vector3.x = GodotMathf.Asin(-num);
                    vector3.y = GodotMathf.Atan2(basis.x[2], basis.z[2]);
                    vector3.z = GodotMathf.Atan2(basis.y[0], basis.y[1]);
                }
                else
                {
                    vector3.x = 1.570796f;
                    vector3.y = -GodotMathf.Atan2(-basis.x[1], basis.x[0]);
                }
            }
            else
            {
                vector3.x = -1.570796f;
                vector3.y = -GodotMathf.Atan2(basis.x[1], basis.x[0]);
            }
            return(vector3);
        }
Ejemplo n.º 2
0
 public float AngleTo(GodotVector3 to)
 {
     return(GodotMathf.Atan2(Cross(to).Length(), Dot(to)));
 }
Ejemplo n.º 3
0
 public float AngleTo(GodotVector2 to)
 {
     return(GodotMathf.Atan2(Cross(to), Dot(to)));
 }
Ejemplo n.º 4
0
 public float AngleToPoint(GodotVector2 to)
 {
     return(GodotMathf.Atan2(x - to.x, y - to.y));
 }
Ejemplo n.º 5
0
 public float Angle()
 {
     return(GodotMathf.Atan2(y, x));
 }