public static void CreateFromYawPitchRoll(Fixed64 yaw, Fixed64 pitch, Fixed64 roll, out Fixed64Quaternion result) { Fixed64 num9 = roll * Fixed64.Half; Fixed64 num6 = Fixed64.Sin(num9); Fixed64 num5 = Fixed64.Cos(num9); Fixed64 num8 = pitch * Fixed64.Half; Fixed64 num4 = Fixed64.Sin(num8); Fixed64 num3 = Fixed64.Cos(num8); Fixed64 num7 = yaw * Fixed64.Half; Fixed64 num2 = Fixed64.Sin(num7); Fixed64 num = Fixed64.Cos(num7); result.x = ((num * num4) * num5) + ((num2 * num3) * num6); result.y = ((num2 * num3) * num5) - ((num * num4) * num6); result.z = ((num * num3) * num6) - ((num2 * num4) * num5); result.w = ((num * num3) * num5) + ((num2 * num4) * num6); }
public static Fixed64Quaternion AngleAxis(Fixed64 angle, Fixed64Vector3 axis) { axis = axis * Fixed64.Deg2Rad; axis.Normalize(); Fixed64 halfAngle = angle * Fixed64.Deg2Rad * Fixed64.Half; Fixed64Quaternion rotation; Fixed64 sin = Fixed64.Sin(halfAngle); rotation.x = axis.x * sin; rotation.y = axis.y * sin; rotation.z = axis.z * sin; rotation.w = Fixed64.Cos(halfAngle); return(rotation); }