コード例 #1
0
 public static float Pitch(Quatf q)
 {
     //return MathFunctions.Degrees((float)Math.Atan2(2.0f * (q.y * q.z + q.w * q.x),
     return(MathF.ToDegrees(MathF.Atan2(2.0f * (q.y * q.z + q.w * q.x),
                                        q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z)));
 }
コード例 #2
0
 public static float Yaw(Quatf q)
 {
     return(MathF.ToDegrees(MathF.Asin(-2.0f * (q.x * q.z - q.w * q.y))));
     //return MathFunctions.Degrees((float)Math.Asin(-2.0f * (q.x * q.z - q.w * q.y)));
 }
コード例 #3
0
 public static float GetAngle(Quatf q)
 {
     //return (float)MathFunctions.Degrees((float)Math.Acos(q.w) * 2.0f);
     return(MathF.ToDegrees(MathF.Acos(q.w) * 2.0f));
 }