1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-02 16:48:55 +00:00

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

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)