C#: Add missing match check in Quaternion.Slerpni

This commit is contained in:
Raul Santos 2022-08-24 12:36:46 +02:00
parent f9998455ce
commit b35fcf3620
No known key found for this signature in database
GPG key ID: B532473AE3A803E4

View file

@ -292,6 +292,17 @@ namespace Godot
/// <returns>The resulting quaternion of the interpolation.</returns>
public Quaternion Slerpni(Quaternion to, real_t weight)
{
#if DEBUG
if (!IsNormalized())
{
throw new InvalidOperationException("Quaternion is not normalized");
}
if (!to.IsNormalized())
{
throw new ArgumentException("Argument is not normalized", nameof(to));
}
#endif
real_t dot = Dot(to);
if (Mathf.Abs(dot) > 0.9999f)