示例#1
0
        public static float Pitch(Quaternion q)
        {
            float3 v = q.ydir();

            return((float)Math.Atan2(v.z, Math.Sqrt(v.x * v.x + v.y * v.y)) * (180.0f / 3.14159264f));
        }
示例#2
0
 public static float Pitch(Quaternion q)
 {
     float3 v = q.ydir();
     return (float)Math.Atan2(v.z, Math.Sqrt(v.x * v.x + v.y * v.y)) * (180.0f / 3.14159264f);
 }
示例#3
0
        public static float Yaw(Quaternion q)
        {
            float3 v = q.ydir();

            return((v.y == 0.0 && v.x == 0.0) ? 0.0f : (float)Math.Atan2(-v.x, v.y) * (180.0f / 3.14159264f));
        }
示例#4
0
 public static float Yaw(Quaternion q)
 {
     float3 v = q.ydir();
     return (v.y == 0.0 && v.x == 0.0) ? 0.0f : (float)Math.Atan2(-v.x, v.y) * (180.0f / 3.14159264f);
 }