示例#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);
        }
 public float AngleTo(GodotVector3 to)
 {
     return(GodotMathf.Atan2(Cross(to).Length(), Dot(to)));
 }
示例#3
0
 public float AngleTo(GodotVector2 to)
 {
     return(GodotMathf.Atan2(Cross(to), Dot(to)));
 }
示例#4
0
 public float AngleToPoint(GodotVector2 to)
 {
     return(GodotMathf.Atan2(x - to.x, y - to.y));
 }
示例#5
0
 public float Angle()
 {
     return(GodotMathf.Atan2(y, x));
 }